challengeAndVerify method

Future<AuthMFAVerifyResponse> challengeAndVerify({
  1. required String factorId,
  2. required String code,
})

Helper method which creates a challenge and immediately uses the given code to verify against it thereafter.

The verification code is provided by the user by entering a code seen in their authenticator app.

Implementation

Future<AuthMFAVerifyResponse> challengeAndVerify({
  required String factorId,
  required String code,
}) async {
  final challengeResponse = await challenge(factorId: factorId);
  return verify(
    factorId: factorId,
    challengeId: challengeResponse.id,
    code: code,
  );
}