You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have just deployed my app on vercel, therefore I changed my URL-s from localhost:3000 to vercels_domain, I have changed supabase url configurations site url: to vercels_domain and added redirect urls: vercels_domain/auth/callback
this is my reset password email template:
<h2>Reset Password</h2>
<p>Follow this link to reset the password for your user:</p>
<p><a href="{{ .ConfirmationURL }}">Reset Password</a></p>
import { createClient } from '../../../../utils/supabase/server';
import { NextResponse } from 'next/server';
export async function GET(request: Request) {
// The `/auth/callback` route is required for the server-side auth flow implemented
// by the SSR package. It exchanges an auth code for the user's session.
// https://supabase.com/docs/guides/auth/server-side/nextjs
const requestUrl = new URL(request.url);
const code = requestUrl.searchParams.get('code');
const origin = requestUrl.origin;
const redirectTo = requestUrl.searchParams.get('redirect_to')?.toString();
if (code) {
const supabase = await createClient();
await supabase.auth.exchangeCodeForSession(code);
}
if (redirectTo) {
return NextResponse.redirect(`${origin}${redirectTo}`);
}
// URL to redirect to after sign up process completes
return NextResponse.redirect(`${origin}/`);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So I have just deployed my app on vercel, therefore I changed my URL-s from localhost:3000 to vercels_domain, I have changed supabase url configurations site url: to vercels_domain and added redirect urls: vercels_domain/auth/callback
this is my reset password email template:
this is part of my
actions.ts
and my auth/callback/route.ts:
when i click on link that i get on email it redirects me to:
https://rkztyyanbfhhmqicfozg.supabase.co/servit.vercel.app?code=b30a39ab-7f16-4505-bd7e-00cee84dc9b3
problme should lie here:
const { error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo:
${origin}/auth/callback?redirect_to=/protected/reset-password
,});
if anypne would explain it to me ,would appreciate a ton!
Beta Was this translation helpful? Give feedback.
All reactions