Auth0 Universal Components
    Preparing search index...

    Interface UserMFAMgmtProps

    Props for the UserMFAMgmt component.

    interface UserMFAMgmtProps {
        customMessages?: Partial<MFAMessages>;
        disableDelete?: boolean;
        disableEnroll?: boolean;
        factorConfig?: Partial<Record<MFAType, FactorConfigOptions>>;
        hideHeader?: boolean;
        onBeforeAction?: (
            action: "enroll" | "delete" | "confirm",
            factorType: MFAType,
        ) => boolean | Promise<boolean>;
        onDelete?: () => void;
        onEnroll?: () => void;
        onErrorAction?: (
            error: Error,
            action: "enroll" | "delete" | "confirm",
        ) => void;
        onFetch?: () => void;
        readOnly?: boolean;
        schema?: Partial<{ email?: RegExp; phone?: RegExp }>;
        showActiveOnly?: boolean;
        styling?: ComponentStyling<UserMFAMgmtClasses>;
    }

    Hierarchy

    • SharedComponentProps<
          MFAMessages,
          UserMFAMgmtClasses,
          { email?: RegExp; phone?: RegExp },
      >
      • UserMFAMgmtProps
    Index

    Properties

    customMessages?: Partial<MFAMessages>
    disableDelete?: boolean

    Whether to disable the ability to delete existing MFA factors.

    false

    disableEnroll?: boolean

    Whether to disable the ability to enroll new MFA factors.

    false

    factorConfig?: Partial<Record<MFAType, FactorConfigOptions>>

    Configuration for individual MFA factor types. Allows hiding or disabling specific factor types.

    factorConfig={{
    sms: { visible: true, enabled: true },
    email: { visible: true, enabled: false },
    otp: { visible: false },
    }}
    hideHeader?: boolean

    Whether to hide the component header.

    false

    onBeforeAction?: (
        action: "enroll" | "delete" | "confirm",
        factorType: MFAType,
    ) => boolean | Promise<boolean>

    Callback invoked before an MFA action is performed. Return false or a Promise resolving to false to cancel the action.

    Type Declaration

      • (
            action: "enroll" | "delete" | "confirm",
            factorType: MFAType,
        ): boolean | Promise<boolean>
      • Parameters

        • action: "enroll" | "delete" | "confirm"

          The action about to be performed ('enroll', 'delete', or 'confirm')

        • factorType: MFAType

          The MFA factor type involved in the action

        Returns boolean | Promise<boolean>

        true to proceed, false to cancel

    onBeforeAction={async (action, factorType) => {
    if (action === 'delete') {
    return await confirmDeletion();
    }
    return true;
    }}
    onDelete?: () => void

    Callback invoked after a factor is successfully deleted.

    onEnroll?: () => void

    Callback invoked after a factor is successfully enrolled.

    onErrorAction?: (error: Error, action: "enroll" | "delete" | "confirm") => void

    Callback invoked when an error occurs during an MFA action.

    Type Declaration

      • (error: Error, action: "enroll" | "delete" | "confirm"): void
      • Parameters

        • error: Error

          The error that occurred

        • action: "enroll" | "delete" | "confirm"

          The action that failed ('enroll', 'delete', or 'confirm')

        Returns void

    onFetch?: () => void

    Callback invoked after factors are successfully fetched.

    readOnly?: boolean

    Whether the component should be in read-only mode. When true, users cannot enroll or delete factors.

    false

    schema?: Partial<{ email?: RegExp; phone?: RegExp }>
    showActiveOnly?: boolean

    Whether to show only active (enrolled) MFA factors. When true, only factors that are currently enrolled will be displayed.

    false

    styling?: ComponentStyling<UserMFAMgmtClasses>