I have /auth/callback in my NextJS (App Router) app that gets triggered perfectly when I confirm my email on a desktop/laptop. But it doesn't seem to work when I confirm my email using a mobile phone using a mobile browser (have tried Safari, Chrome).
Why is this happening?
/auth/callback/route.js file: import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs"; import { cookies } from "next/headers"; import { NextResponse } from "next/server";
export async function GET(request) { const requestUrl = new URL(request.url); const code = requestUrl.searchParams.get("code");
if (code) { const supabase = createRouteHandlerClient({ cookies }); await supabase.auth.exchangeCodeForSession(code); }
// URL to redirect to after sign in process completes return NextResponse.redirect(
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.