Closed limegorilla closed 1 week ago
Upgrading to ssr 0.4.1 should resolve this. You'll either have to use the specific version number or the @patched tag instead of @latest.
Latest is now 0.5.0
which should contain the fix for this issue too.
Hey thanks for flagging, going to close the issue for now but let us know if upgrading does not resolve the issue.
Bug report
Describe the bug
I've been running around this quite a bit.
I'm using NextJs 14 and trying to get the password reset flow to work properly. I'll note now that the MagicLink flow works perfectly.
When the user is redirected to my
confirm
route, I should get their session - which as per my logs, I do. However, with only the reset password flow, this doesn't actually update on the Supabase client.To Reproduce
Done as per the docs
auth/v2/login
)auth/v2/forgot-password
href="{{ .SiteURL }}/auth/v2/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/auth/v2/recovery"
export async function GET(request: NextRequest) { const { searchParams, origin } = new URL(request.url); const token_hash = searchParams.get("token_hash"); const type = searchParams.get("type") as EmailOtpType | null; const next = type === "recovery" ? "/app/settings/account" : "/app"; // Edited here so I didn't have to keep re-rendering my email. Have tried sending this round the app just in case it's a problem with caching etc. const redirectTo = request.nextUrl.clone(); redirectTo.pathname = next;
if (token_hash && type) { const supabase = createClient();
}
const er = new Error("Missing token", { cause: "auth", });
const seid = Sentry.captureException(er, { data: { ...request }, });
// Missing code return NextResponse.redirect(
${origin}/auth/v2/error?name=${er.name}&message=${er.message}&code=500&sentry_digest=${seid}
, ); }I get the following logs
Expected behavior
User's session should save to supabase client
System information