Creates an instance of the MfaPhoneEnrollment screen.
Static
screenContinues the enrollment process with the provided phone number and type (SMS or voice).
The phone number and type (SMS or voice).
import MfaPhoneEnrollment from '@auth0/auth0-acul-js/mfa-phone-enrollment';
const mfaPhoneEnrollmentManager = new MfaPhoneEnrollment();
async function handleContinueEnrollment() {
try {
await mfaPhoneEnrollmentManager.continueEnrollment({
phone: '+1234567890',
type: 'sms', // or 'voice'
});
console.log('Phone enrollment continued successfully.');
} catch (error) {
console.error('Error continuing phone enrollment:', error);
}
}
Navigates to the country code selection screen.
Optional
payload: Classes.CustomOptionsOptional custom options to include with the request.
import MfaPhoneEnrollment from '@auth0/auth0-acul-js/mfa-phone-enrollment';
const mfaPhoneEnrollmentManager = new MfaPhoneEnrollment();
async function handlePickCountryCode() {
try {
await mfaPhoneEnrollmentManager.pickCountryCode();
console.log('Country code selection successful.');
} catch (error) {
console.error('Error selecting country code:', error);
}
Allows the user to try another MFA method.
Optional
payload: Classes.CustomOptionsOptional custom options to include with the request.
import MfaPhoneEnrollment from '@auth0/auth0-acul-js/mfa-phone-enrollment';
const mfaPhoneEnrollmentManager = new MfaPhoneEnrollment();
async function handleTryAnotherMethod() {
try {
await mfaPhoneEnrollmentManager.tryAnotherMethod();
console.log('Switched to another authentication method.');
} catch (error) {
console.error('Error switching authenticator method:', error);
}
}
Class implementing the mfa-phone-enrollment screen functionality. This screen allows users to enroll using a phone number for MFA.