Home

Send a password reset request

Sends a reset request to an email address.

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:

final res = await supabase.auth.api.updateUser(
  accessToken,
  UserAttributes(password: 'NEW_PASSWORD'),
);

final res = await supabase.auth.api.resetPasswordForEmail('user@example.com');

final error = res.error;