diff --git a/web/src/app/auth/callback/route.ts b/web/src/app/auth/callback/route.ts index 7b1243407..41018a234 100644 --- a/web/src/app/auth/callback/route.ts +++ b/web/src/app/auth/callback/route.ts @@ -7,6 +7,7 @@ export async function GET(request: Request) { const code = searchParams.get('code_challenge') || searchParams.get('code'); //we were not seeing code, just code_challenge? // if "next" is in param, use it as the redirect URL const next = searchParams.get('next') ?? '/'; + if (code) { const supabase = await createClient(); const { error } = await supabase.auth.exchangeCodeForSession(code); @@ -23,6 +24,8 @@ export async function GET(request: Request) { return NextResponse.redirect(`${origin}/app`); } } + + console.error('ERROR EXCHANGING CODE FOR SESSION', { error }); } // return the user to an error page with instructions diff --git a/web/src/app/auth/confirm/route.ts b/web/src/app/auth/confirm/route.ts index b9512debc..2b87f92a8 100644 --- a/web/src/app/auth/confirm/route.ts +++ b/web/src/app/auth/confirm/route.ts @@ -20,9 +20,14 @@ export async function GET(request: NextRequest) { if (!error) { // redirect user to specified redirect URL or root of app redirect(next); + return; } + + console.error(error); } + console.error('NO TOKEN HASH OR TYPE', { token_hash, type }); + // redirect the user to an error page with some instructions redirect('/auth/auth-code-error'); }