Fix email confirmation redirect missing basePath
- Use NEXT_PUBLIC_APP_URL instead of window.location.origin - Ensures email confirmation redirects to /leopost/auth/callback/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,11 +50,14 @@ export function RegisterForm() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use configured APP_URL to include basePath in redirect
|
||||||
|
const appUrl = process.env.NEXT_PUBLIC_APP_URL || window.location.origin
|
||||||
|
|
||||||
const { error: signUpError } = await supabase.auth.signUp({
|
const { error: signUpError } = await supabase.auth.signUp({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
options: {
|
options: {
|
||||||
emailRedirectTo: `${window.location.origin}/auth/callback`,
|
emailRedirectTo: `${appUrl}/auth/callback/`,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user