verifyOtpLoginCode method
Future<EmailAccountOtpVerificationResult>
verifyOtpLoginCode(
- Session session, {
- required UuidValue otpLoginRequestId,
- required String verificationCode,
Verifies a one-time password and returns a token to complete the login.
If EmailAccountOtpVerificationResult.accountExists is true, pass the
token to finishOtpLogin to sign in. Otherwise, have the user accept the
terms (and optionally set a password if
EmailAccountOtpVerificationResult.allowPassword is true) and pass it
to finishOtpRegistration to create the account.
Throws an EmailAccountRequestException in case of errors, with reason:
- EmailAccountRequestExceptionReason.expired if the login request has already expired.
- EmailAccountRequestExceptionReason.tooManyAttempts if the user has made too many attempts to verify the code.
- EmailAccountRequestExceptionReason.invalid if no request exists for
the given
otpLoginRequestIdorverificationCodeis invalid.
Implementation
Future<EmailAccountOtpVerificationResult> verifyOtpLoginCode(
Session session, {
required UuidValue otpLoginRequestId,
required String verificationCode,
}) async {
return emailIdp.verifyOtpLoginCode(
session,
otpLoginRequestId: otpLoginRequestId,
verificationCode: verificationCode,
);
}