resetPasswordForEmail()
Sends a reset request to an email address.
const { data, error } = await supabase.auth.api
.resetPasswordForEmail('user@email.com')
Parameters
emailrequired
string
The email address of the user.
optionsrequired
object
No description provided.
captchaTokenoptional
string
No description provided.
redirectTooptional
string
No description provided.
Properties
Notes
Sends a reset request to an email address.
When the user clicks the reset link in the email they will be forwarded to:
<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery
Your app must detect type=recovery
in the fragment and display a password reset form to the user.
You should then use the access_token in the url and new password to update the user as follows:
const { error, data } = await supabase.auth.api
.updateUser(access_token, { password : new_password })
Examples
Reset password
const { data, error } = await supabase.auth.api
.resetPasswordForEmail('user@email.com')