verifyOtpLoginCode method

Future<EmailAccountOtpVerificationResult> verifyOtpLoginCode(
  1. Session session, {
  2. required UuidValue otpLoginRequestId,
  3. 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:

Implementation

Future<EmailAccountOtpVerificationResult> verifyOtpLoginCode(
  Session session, {
  required UuidValue otpLoginRequestId,
  required String verificationCode,
}) async {
  return emailIdp.verifyOtpLoginCode(
    session,
    otpLoginRequestId: otpLoginRequestId,
    verificationCode: verificationCode,
  );
}