Reputation: 11
Im try to reset password user for supabase in react but it says resetPasswordForEmail is undefined```
const { data, error } = await supabase.auth.api.resetPasswordForEmail(email)
if (data) {
console.log(data)
}
if (error) {
console.log(error)
}
}
I try to run the code but it gives and error because of an undefined function I expected to send an email
Upvotes: 1
Views: 4011
Reputation: 244
You're probably on v2, it should be:
supabase.auth.resetPasswordForEmail
Not:
supabase.auth.api.resetPasswordForEmail
For reference: https://supabase.com/docs/reference/javascript/auth-resetpasswordforemail
Check this out as well, it has some important notes you may need to know: https://github.com/supabase/supabase/discussions/3360#discussioncomment-3947228
Upvotes: 6