@auth0/auth0-acul-js - v0.1.0-beta.7
    Preparing search index...

    Class MfaPhoneEnrollment

    Class implementing the mfa-phone-enrollment screen functionality. This screen allows users to enroll using a phone number for MFA.

    Hierarchy

    • BaseContext
      • MfaPhoneEnrollment

    Implements

    Index

    Constructors

    Properties

    screenIdentifier: string = ScreenIds.MFA_PHONE_ENROLLMENT

    Methods

    • Continues the enrollment process with the provided phone number and type (SMS or voice).

      Parameters

      • payload: { phone: string; type: "sms" | "voice" }

        The phone number and type (SMS or voice).

      Returns Promise<void>

      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);
      }
      }
    • Retrieves the array of transaction errors from the context, or an empty array if none exist.

      Returns Classes.Error[]

      An array of error objects from the transaction context.

    • Navigates to the country code selection screen.

      Parameters

      Returns Promise<void>

      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.

      Parameters

      Returns Promise<void>

      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);
      }
      }