Skip to main content
The MfaRecoveryCodeEnrollment class implements the mfa-recovery-code-enrollment screen functionality. This screen is displayed when the user needs to enroll with a recovery code for MFA.
MfaRecoveryCodeEnrollment

Constructors

Create an instance of MfaRecoveryCodeEnrollment screen
Example
import MfaRecoveryCodeEnrollment from '@auth0/auth0-acul-js/mfa-recovery-code-enrollment';
const mfaRecoveryCodeEnrollmentManager = new MfaRecoveryCodeEnrollment();
const continueEnrollment = async (payload) => {
 try {
   await mfaRecoveryCodeEnrollmentManager.continue(payload);
   console.log('Enrollment continued successfully.');
 } catch (error) {
   console.error('Error continuing enrollment:', error);
 }
};

Properties

branding
Provides branding-related configurations, such as branding theme and settings.
client
Provides client-related configurations, such as id, name, and logoUrl.
organization
Provides information about the user’s organization, such as organization id and name.
prompt
Contains data about the current prompt in the authentication flow.
screen
Contains details specific to the mfa-recovery-code-enrollment screen, including its configuration and context.
tenant
Contains data related to the tenant, such as id and associated metadata.
transaction
Provides transaction-specific data, such as active identifiers and flow states.
untrustedData
Handles untrusted data passed to the SDK, such as user input during login.
user
Details of the active user, including username, email, and roles.

Methods

continue
(options ?)
This method declares that the user saved the recovery code. This action is triggered when the user declares that they have saved the recovery code. It redirects to the next screen in the authentication flow. Returns a promise that resolves when the action is successfully submitted.
Example
import MfaRecoveryCodeEnrollment from '@auth0/auth0-acul-js/mfa-recovery-code-enrollment';
const mfaRecoveryCodeEnrollmentManager = new MfaRecoveryCodeEnrollment();
const continueEnrollment = async (payload) => {
 try {
   await mfaRecoveryCodeEnrollmentManager.continue(payload);
   console.log('Enrollment continued successfully.');
 } catch (error) {
   console.error('Error continuing enrollment:', error);
 }
};
options
OPTIONAL
An object containing any custom options.
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.