verifyRegistrationCode method
Future<String>
verifyRegistrationCode(
- Session session, {
- required UuidValue accountRequestId,
- required String verificationCode,
- required Transaction transaction,
Method for verifying the account request code returned by startRegistration.
Can throw the following EmailAccountRequestServerException subclasses:
- EmailAccountRequestVerificationTooManyAttemptsException in case the user has made too many attempts to verify the account.
- EmailAccountRequestNotFoundException if the request does not exist or has already been completed.
- EmailAccountRequestVerificationCodeAlreadyUsedException if the verification code has already been used.
- EmailAccountRequestInvalidVerificationCodeException if the provided verification code is not valid.
- EmailAccountRequestVerificationExpiredException if the request is completed with the correct verification code, but has already expired. but has not been cleaned up yet.
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(
final Session session, {
required final UuidValue accountRequestId,
required final String verificationCode,
required final Transaction transaction,
}) async {
return await withReplacedSecretChallengeException(
() => _challengeUtil.verifyChallenge(
session,
requestId: accountRequestId,
verificationCode: verificationCode,
transaction: transaction,
),
);
}