Javascript Reference v1.0

Send a password reset request

Sends a password reset request to an email address.

  • When the user clicks the reset link in the email they are redirected back to your application. You can configure the URL that the user is redirected to via the redirectTo param. See redirect URLs and wildcards to add additional redirect URLs to your project.
  • After the user has been redirected successfully, prompt them for a new password and call updateUser():
1const { data, error } = await supabase.auth.update({
2  password: new_password,
3})

const { data, error } = await supabase.auth.api.resetPasswordForEmail(
  email,
  { redirectTo: 'https://example.com/update-password' }
)