confirmPasswordReset method

Future<void> confirmPasswordReset(
  1. String token,
  2. String password, {
  3. required void onSuccess(),
  4. required void onError(
    1. SyneriseError error
    ),
})

This function confirms a password reset using a token and a new password.

Args: token (String): The token is a unique string that is generated when a user requests to reset their password. This token is used to verify the user's identity when they reset their password. password (String): The password parameter is a string that represents the new password that the user wants to set for their account after resetting their password.

Implementation

Future<void> confirmPasswordReset(String token, String password,
    {required void Function() onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<void> result =
      await _methods.confirmPasswordReset(token, password);

  result.onSuccess((result) {
    onSuccess();
  }).onError((error) {
    onError(error);
  });
}