password route

This commit is contained in:
colinislit
2025-11-19 12:26:12 +01:00
parent d32b47407b
commit 55c30b17f5
2 changed files with 2 additions and 58 deletions

View File

@@ -128,9 +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
// Redirect to callback route which will handle code exchange and redirect to /update-password
const { error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo: `${window.location.origin}/update-password`
redirectTo: `${window.location.origin}/auth/callback?next=/update-password`
})
if (error) throw error