Home > @firebase/auth > sendPasswordResetEmail
sendPasswordResetEmail() function
Sends a password reset email to the given email address.
Signature:
export declare function sendPasswordResetEmail(auth: Auth, email: string, actionCodeSettings?: ActionCodeSettings): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
auth | Auth | The Auth instance. |
string | The user's email address. | |
actionCodeSettings | ActionCodeSettings | The ActionCodeSettings. |
Returns:
Promise<void>
Description
To complete the password reset, call confirmPasswordReset() with the code supplied in the email sent to the user, along with the new password specified by the user.
Example
const actionCodeSettings = {
url: 'https://www.example.com/?email=user@example.com',
iOS: {
bundleId: 'com.example.ios'
},
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
},
handleCodeInApp: true
};
await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings);
// Obtain code from user.
await confirmPasswordReset('user@example.com', code);