verifyPasswordResetCode method

Future<String> verifyPasswordResetCode(
  1. Session session, {
  2. required UuidValue passwordResetRequestId,
  3. required String verificationCode,
  4. required Transaction transaction,
})

Returns the credentials for setting the password for the password reset request.

This method should only be called after the startPasswordReset method has been called successfully.

The method returns a completePasswordResetToken that can be used to complete the password reset.

Can throw the following EmailPasswordResetServerException subclasses:

In case of an invalid verificationCode or passwordResetRequestId, the failed password reset completion will be logged to the database outside of the transaction and can not be rolled back.

Implementation

Future<String> verifyPasswordResetCode(
  final Session session, {
  required final UuidValue passwordResetRequestId,
  required final String verificationCode,
  required final Transaction transaction,
}) async {
  return await withReplacedSecretChallengeException(
    () => _challengeUtil.verifyChallenge(
      session,
      requestId: passwordResetRequestId,
      verificationCode: verificationCode,
      transaction: transaction,
    ),
  );
}