Skip to main content
MfaRecoveryCodeChallengeNewCodeMembers
Example
export interface MfaRecoveryCodeChallengeNewCodeMembers extends BaseMembers {
  /**
   * Access to the specific properties and data of the 'mfa-recovery-code-challenge-new-code' screen.
   * Includes the `textCode` which is the recovery code to be displayed.
   * @type {ScreenMembersOnMfaRecoveryCodeChallengeNewCode}
   */
  screen: ScreenMembersOnMfaRecoveryCodeChallengeNewCode;

  /**
   * Confirms that the user has saved the new recovery code and continues the authentication flow.
   * This method should be called after the user indicates they have securely stored the displayed recovery code.
   * It sends a confirmation to the Auth0 server to proceed to the next step.
   *
   * @param {ContinueOptions} [payload] - Optional custom data to include with the request.
   * @returns {Promise<void>} A promise that resolves when the confirmation is successfully submitted.
   * @throws {Error} Throws an error if the submission fails (e.g., network issue, invalid state).
   *
   * @example
   * ```typescript
   * import MfaRecoveryCodeChallengeNewCode from '@auth0/auth0-acul-js/mfa-recovery-code-challenge-new-code';
   *
   * const screenManager = new MfaRecoveryCodeChallengeNewCode();
   *
   * // Assuming the user has checked a box confirming they saved the code
   * try {
   *   await screenManager.continue();
   *   // Redirects to the next screen on success
   * } catch (error) {
   *   console.error("Failed to confirm recovery code saved:", error);
   *   // Handle error, e.g., display a message from screenManager.transaction.errors
   * }
   * ```
   */
  continue(payload?: ContinueOptions): Promise<void>;
}

Properties

branding
client
organization
prompt
screen
Access to the specific properties and data of the ‘mfa-recovery-code-challenge-new-code’ screen. Includes the textCode which is the recovery code to be displayed.
tenant
transaction
untrustedData
user

Methods

continue
Promise<void>
Confirms that the user has saved the new recovery code and continues the authentication flow. This method should be called after the user indicates they have securely stored the displayed recovery code. It sends a confirmation to the Auth0 server to proceed to the next step.A promise that resolves when the confirmation is successfully submitted.

Throws

Throws an error if the submission fails (e.g., network issue, invalid state).
Example
import MfaRecoveryCodeChallengeNewCode from '@auth0/auth0-acul-js/mfa-recovery-code-challenge-new-code';

const screenManager = new MfaRecoveryCodeChallengeNewCode();

// Assuming the user has checked a box confirming they saved the code
try {
  await screenManager.continue();
  // Redirects to the next screen on success
} catch (error) {
  console.error("Failed to confirm recovery code saved:", error);
  // Handle error, e.g., display a message from screenManager.transaction.errors
}