updatePassword method

Future<void> updatePassword(
  1. String newPassword
)

Updates the user's email address.

An email will be sent to the original email address (if it was set) that allows to revoke the email address change, in order to protect them from account hijacking.

Important: this is a security sensitive operation that requires the user to have recently signed in. If this requirement isn't met, ask the user to authenticate again and then call User.reauthenticateWithCredential.

Updates the user's password.

Important: this is a security sensitive operation that requires the user to have recently signed in. If this requirement isn't met, ask the user to authenticate again and then call User.reauthenticateWithCredential.

A FirebaseAuthException maybe thrown with the following error code:

  • weak-password:
  • Thrown if the password is not strong enough.
  • requires-recent-login:
  • Thrown if the user's last sign-in time does not meet the security threshold. Use User.reauthenticateWithCredential to resolve. This does not apply if the user is anonymous.

Implementation

/// Updates the user's password.
///
/// **Important**: this is a security sensitive operation that requires the
///   user to have recently signed in. If this requirement isn't met, ask the
///   user to authenticate again and then call [User.reauthenticateWithCredential].
///
/// A [FirebaseAuthException] maybe thrown with the following error code:
/// - **weak-password**:
///  - Thrown if the password is not strong enough.
/// - **requires-recent-login**:
///  - Thrown if the user's last sign-in time does not meet the security
///    threshold. Use [User.reauthenticateWithCredential] to resolve. This
///    does not apply if the user is anonymous.
Future<void> updatePassword(String newPassword) async {
  await _delegate.updatePassword(newPassword);
}