@@ -2,32 +2,33 @@ import { MiddlewareRequest } from '@netlify/next';
22
33export async function middleware ( nextRequest ) {
44
5- if ( nextRequest . nextUrl . pathname !== '/signup' ) {
6- return ;
7- }
5+ return ;
6+ // if (nextRequest.nextUrl.pathname !== '/signup') {
7+ // return;
8+ // }
89
9- const middlewareRequest = new MiddlewareRequest ( nextRequest ) ;
10- const response = await middlewareRequest . next ( ) ;
10+ // const middlewareRequest = new MiddlewareRequest(nextRequest);
11+ // const response = await middlewareRequest.next();
1112
12- const GOOGLE_API_KEY = Deno . env . get ( 'NEXT_PUBLIC_GOOGLE_API_KEY' ) ;
13- const address = nextRequest . cookies . get ( 'state' ) ;
14- const country = nextRequest . cookies . get ( 'country' ) ?? '' ;
13+ // const GOOGLE_API_KEY = Deno.env.get('NEXT_PUBLIC_GOOGLE_API_KEY');
14+ // const address = nextRequest.cookies.get('state');
15+ // const country = nextRequest.cookies.get('country') ?? '';
1516
16- const api = new URL ( 'https://maps.googleapis.com/maps/api/geocode/json' ) ;
17+ // const api = new URL('https://maps.googleapis.com/maps/api/geocode/json');
1718
18- api . searchParams . set ( 'address' , `${ address } ${ country } ` ) ;
19- api . searchParams . set ( 'key' , GOOGLE_API_KEY ) ;
19+ // api.searchParams.set('address', `${address}${country}`);
20+ // api.searchParams.set('key', GOOGLE_API_KEY);
2021
21- const res = await fetch ( api . toString ( ) ) ;
22- const data = await res . json ( ) ;
23- const [ result ] = data . results ;
22+ // const res = await fetch(api.toString());
23+ // const data = await res.json();
24+ // const [result] = data.results;
2425
25- if ( ! result || ! result . geometry || ! result . geometry . location ) {
26- return ;
27- }
26+ // if (!result || !result.geometry || !result.geometry.location) {
27+ // return;
28+ // }
2829
29- response . setPageProp ( 'address' , address ) ;
30- response . setPageProp ( 'mapCords' , result . geometry . location ) ;
30+ // response.setPageProp('address', address);
31+ // response.setPageProp('mapCords', result.geometry.location);
3132
32- return response ;
33+ // return response;
3334}
0 commit comments