callback routes

This commit is contained in:
colinislit
2025-11-19 12:22:52 +01:00
parent bc26313859
commit d32b47407b
4 changed files with 70 additions and 13 deletions

View File

@@ -128,8 +128,9 @@ export async function signUpWithPassword(email: string, password: string) {
*/
export async function resetPasswordForEmail(email: string) {
const supabase = createClient()
// Redirect directly to /update-password - route handler will do code exchange
const { error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo: `${window.location.origin}/auth/callback?next=/update-password`
redirectTo: `${window.location.origin}/update-password`
})
if (error) throw error