updatePassword method

Future<void> updatePassword(
  1. String newPassword
)

Updates the users login password.

Replaces the users current password with newPassword. If the request fails, an AuthException will be thrown.

This request can only be used, if the user has logged in via email/password. When logged in anonymously or via an IDP-Provider, this request will always fail. You can instead link the account with an email address and a new password via linkEmail().

Implementation

Future<void> updatePassword(String newPassword) async {
  final response = await api.updatePassword(
    PasswordUpdateRequest(
      idToken: _idToken,
      password: newPassword,
    ),
  );
  _applyToken(
    idToken: response.idToken,
    refreshToken: response.refreshToken,
    expiresIn: response.expiresIn,
  );
}