Skip to main content
The MfaRecoveryCodeChallengeNewCode screen class provides methods associated with the mfa-recovery-code-challenge-new-code screen. This screen displays the MFA recovery code for safe keeping.
MfaRecoveryCodeChallengeNewCode

Constructors

Create an instance of MfaRecoveryCodeChallengeNewCode screen
Example
import MfaRecoveryCodeChallengeNewCode from '@auth0/auth0-acul-js/mfa-recovery-code-challenge-new-code';
const screenManager = new MfaRecoveryCodeChallengeNewCode();
// Assuming a checkbox 'confirmSaved' is checked by the user
if (confirmSaved) {
  try {
    await screenManager.continue({ customData: 'optionalValue' });
  } catch (err) {
    // Handle errors, potentially check screenManager.transaction.errors
    console.error("Confirmation failed:", err);
  }
} else {
  // Prompt user to confirm saving the code
}

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-challenge-new-code“ 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 confirms that the user has saved the new recovery code and continues the authentication flow. This method sends a POST request to the /u/mfa-recovery-code-challenge-new-code endpoint with the required state, action, and saved parameters.A promise that resolves when the confirmation is successfully submitted. On success, the browser will typically be redirected to the next step.Throws an error if the form submission fails (e.g., network issue, invalid state, or if the server responds with a 400 error like ‘no-confirmation’).
Example
const screenManager = new MfaRecoveryCodeChallengeNewCode();
// Assuming a checkbox 'confirmSaved' is checked by the user
if (confirmSaved) {
  try {
    await screenManager.continue({ customData: 'optionalValue' });
  } catch (err) {
    // Handle errors, potentially check screenManager.transaction.errors
    console.error("Confirmation failed:", err);
  }
} else {
  // Prompt user to confirm saving the code
}
options
OPTIONAL
Optional custom data to include with the request form body.
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.