Skip to main content
The MfaRecoveryCodeChallenge class implements the mfa-recovery-code-challenge screen functionality. This screen is displayed when the user needs to enter a recovery code to log in.
MfaRecoveryCodeChallenge

Constructors

Create an instance of MfaRecoveryCodeChallenge screen
Example
import MfaRecoveryCodeChallenge from '@auth0/auth0-acul-js/mfa-recovery-code-challenge';
const mfaRecoveryCodeChallengeManager = new MfaRecoveryCodeChallenge();
const handleContinueEnrollment = async () => {
 try {
   await mfaRecoveryCodeChallengeManager.continue('YOUR_RECOVERY_CODE');
 } catch (error) {
   console.error('Error continuing with recovery code:', 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 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 continues with the provided recovery code.
Example
import MfaRecoveryCodeChallenge from '@auth0/auth0-acul-js/mfa-recovery-code-challenge';
const mfaRecoveryCodeChallengeManager = new MfaRecoveryCodeChallenge();
const handleContinueEnrollment = async () => {
 try {
   await mfaRecoveryCodeChallengeManager.continue('YOUR_RECOVERY_CODE');
 } catch (error) {
   console.error('Error continuing with recovery code:', error);
 }
}
options
OPTIONAL
The payload containing the recovery code and optional custom options.
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.
tryAnotherMethod
(options ?)
This method navigates to the screen where the user can pick another MFA method.
Example
import MfaRecoveryCodeChallenge from '@auth0/auth0-acul-js/mfa-recovery-code-challenge';
const mfaRecoveryCodeChallengeManager = new MfaRecoveryCodeChallenge();
const switchAuthenticator = async () => {
 try {
   await mfaRecoveryCodeChallengeManager.tryAnotherMethod();
   console.log('Switched to another authentication method.');
 } catch (error) {
   console.error('Error switching authenticator:', error);
 }
};
options
OPTIONAL
Optional custom options to include with the request.