Hi guys,
I couldn’t find information on how to get the geo in the middleware. For example, a user go on the website and I create a cookie location: Canada or location: city
For now I tried, but no success. It’s always USx:
export default async function middleware(req: NextRequest) {
const { nextUrl: url, geo } = req;
const city = geo?.latitude ?? 'USx';
const res = NextResponse.next();
const supabase = createMiddlewareSupabaseClient({ req, res });
res.cookies.set('city', city);
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!