verifyOtp method
Verifies an enrollment using a one-time password otp.
Use this after calling an enrollment method (e.g., enrollPhone, enrollEmail, enrollTotp) to confirm the enrollment.
factorType must match the enrolled factor: "phone", "email", or
"totp".
Returns the confirmed AuthenticationMethod after successful verification.
id and authSession are obtained from the EnrollmentChallenge
returned by the enrollment method.
Requires an access token with the create:me:authentication_methods
scope and audience https://{domain}/me/.
Usage example
final method = await myAccount.verifyOtp(
id: challenge.id,
authSession: challenge.authSession,
otp: '123456',
factorType: 'totp',
);
Implementation
Future<AuthenticationMethod> verifyOtp({
required String id,
required String authSession,
required String otp,
required String factorType,
}) =>
Auth0FlutterWebPlatform.instance
.verifyOtp(_accessToken, id, authSession, otp, factorType);