verifyRegistrationCode method

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

Method for verifying the account request code returned by startRegistration.

Can throw the following EmailAccountRequestServerException subclasses:

In case of an invalid verificationCode, the failed attempt will be logged to the database outside of the transaction and can not be rolled back.

Successfully verifying the account request code will return a token that can be used to complete the account creation process via completeAccountCreation.

Implementation

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