Starts the enrollment process for a new Multi-Factor Authentication (MFA) factor. This method creates a new unverified factor. To verify a factor, present the QR code or secret to the user and ask them to add it to their authenticator app. The user has to enter the code from their authenticator app to verify it.
totp or phone as the factorType and the returned id to create a challenge.mfa.challenge().mfa.verify().mfa.challengeAndVerify().Type of factor being enrolled.
Domain which the user is enrolled with.
Human readable name assigned to the factor.
Phone number to enroll for phone factor type.
final res = await supabase.auth.mfa.enroll(factorType: FactorType.totp);
final qrCodeUrl = res.totp.qrCode;
final res = await supabase.auth.mfa.enroll(factorType: FactorType.phone, phone: '+1234567890');
final phone = res.phone;