Skip to main content
MfaWebAuthnChangeKeyNicknameMembers
Example
export interface MfaWebAuthnChangeKeyNicknameMembers extends BaseMembers {
  /**
   * The screen object with MFA WebAuthn Change Key Nickname specific data structure.
   */
  screen: ScreenMembersOnMfaWebAuthnChangeKeyNickname;
  
  /**
   * Submits the new nickname for the WebAuthn security key.
   * This action corresponds to the user entering a new nickname and clicking a "Save" or "Continue" button.
   * The SDK will POST this new nickname to the Auth0 `/u/mfa-webauthn-change-key-nickname` endpoint.
   *
   * If the new nickname is valid and the update is successful, Auth0 will typically redirect the user
   * to the next appropriate screen (e.g., back to MFA factor management or a success confirmation).
   * If the nickname is invalid (e.g., empty, too long, too short), Auth0 will re-render the
   * 'mfa-webauthn-change-key-nickname' screen, and the `transaction.errors` array in the SDK's
   * context will be updated with details about the validation failure.
   *
   * @param {ContinueOptions} payload - An object containing the `nickname` (string) entered by the user.
   *                                    It can also include any `CustomOptions` for extensibility.
   * @returns {Promise<void>} A promise that resolves when the form submission is initiated.
   *                          It does not return data directly upon resolution, as a redirect or
   *                          page re-render is the common outcome.
   * @throws {Error} Throws an error if `payload.nickname` is not provided or is not a string,
   *                 or if the `FormHandler` encounters an unrecoverable issue during submission (e.g., network error).
   *                 Validation errors from Auth0 (like an invalid nickname) are not thrown as JavaScript errors
   *                 but are reflected in `this.transaction.errors` after the operation.
   *
   * @example
   * ```typescript
   * // Assuming 'sdk' is an instance of MfaWebAuthnChangeKeyNickname
   * const newNickname = "My Favorite YubiKey"; // Value from user input
   * try {
   *   await sdk.continueWithNewNickname({ nickname: newNickname });
   *   // If successful, page redirects.
   * } catch (error) {
   *   // This catch is for unexpected errors during the SDK call itself.
   *   console.error("Failed to submit the new nickname:", error);
   * }
   * // After the await, always check sdk.transaction.errors for server-side validation issues.
   * if (sdk.transaction.errors && sdk.transaction.errors.length > 0) {
   *   sdk.transaction.errors.forEach(err => {
   *     if (err.field === 'nickname') {
   *       // Display err.message related to the nickname input field.
   *       // e.g., "Name is too short", "Name is required"
   *     }
   *   });
   * }
   * ```
   */
  continueWithNewNickname(payload: ContinueOptions): Promise<void>;
}

Properties

branding
client
organization
prompt
screen
The screen object with MFA WebAuthn Change Key Nickname specific data structure.
tenant
transaction
untrustedData
user

Methods

continueWithNewNickname
Promise<void>
Submits the new nickname for the WebAuthn security key. This action corresponds to the user entering a new nickname and clicking a “Save” or “Continue” button. The SDK will POST this new nickname to the Auth0 /u/mfa-webauthn-change-key-nickname endpoint.If the new nickname is valid and the update is successful, Auth0 will typically redirect the user to the next appropriate screen (e.g., back to MFA factor management or a success confirmation). If the nickname is invalid (e.g., empty, too long, too short), Auth0 will re-render the ‘mfa-webauthn-change-key-nickname’ screen, and the transaction.errors array in the SDK’s context will be updated with details about the validation failure.A promise that resolves when the form submission is initiated. It does not return data directly upon resolution, as a redirect or page re-render is the common outcome.

Throws

Throws an error if payload.nickname is not provided or is not a string, or if the FormHandler encounters an unrecoverable issue during submission (e.g., network error). Validation errors from Auth0 (like an invalid nickname) are not thrown as JavaScript errors but are reflected in this.transaction.errors after the operation.
Example
// Assuming 'sdk' is an instance of MfaWebAuthnChangeKeyNickname
const newNickname = "My Favorite YubiKey"; // Value from user input
try {
  await sdk.continueWithNewNickname({ nickname: newNickname });
  // If successful, page redirects.
} catch (error) {
  // This catch is for unexpected errors during the SDK call itself.
  console.error("Failed to submit the new nickname:", error);
}
// After the await, always check sdk.transaction.errors for server-side validation issues.
if (sdk.transaction.errors && sdk.transaction.errors.length > 0) {
  sdk.transaction.errors.forEach(err => {
    if (err.field === 'nickname') {
      // Display err.message related to the nickname input field.
      // e.g., "Name is too short", "Name is required"
    }
  });
}