Auth0 Universal Components
    Preparing search index...

    Type Alias UseMFAResult

    Result returned by the useMFA hook. Provides methods to fetch, enroll, and delete MFA authenticators.

    type UseMFAResult = {
        confirmEnrollment: (
            factorType: MFAType,
            authSession: string,
            authenticationMethodId: string,
            options: ConfirmEnrollmentOptions,
        ) => Promise<unknown>;
        deleteMfa: (authenticatorId: string) => Promise<void>;
        enrollMfa: (
            factorType: MFAType,
            options?: EnrollOptions,
        ) => Promise<CreateAuthenticationMethodResponseContent>;
        fetchFactors: (onlyActive?: boolean) => Promise<unknown>;
    }
    Index

    Properties

    confirmEnrollment: (
        factorType: MFAType,
        authSession: string,
        authenticationMethodId: string,
        options: ConfirmEnrollmentOptions,
    ) => Promise<unknown>
    deleteMfa: (authenticatorId: string) => Promise<void>

    Delete an enrolled MFA authenticator by its ID.

    Type Declaration

      • (authenticatorId: string): Promise<void>
      • Parameters

        • authenticatorId: string

          The ID of the authenticator to delete.

        Returns Promise<void>

        A promise resolving to a success flag.

    enrollMfa: (
        factorType: MFAType,
        options?: EnrollOptions,
    ) => Promise<CreateAuthenticationMethodResponseContent>

    Enroll a new MFA factor (e.g., SMS, TOTP, Email).

    Type Declaration

      • (
            factorType: MFAType,
            options?: EnrollOptions,
        ): Promise<CreateAuthenticationMethodResponseContent>
      • Parameters

        • factorType: MFAType

          The type of MFA to enroll.

        • Optionaloptions: EnrollOptions

          Optional options like phone number or email.

        Returns Promise<CreateAuthenticationMethodResponseContent>

        A promise resolving to the enrollment response.

    fetchFactors: (onlyActive?: boolean) => Promise<unknown>

    Fetch the list of MFA authenticators grouped by factor type.

    Type Declaration

      • (onlyActive?: boolean): Promise<unknown>
      • Parameters

        • OptionalonlyActive: boolean

          Whether to return only active authenticators.

        Returns Promise<unknown>

        A promise resolving to factors grouped by type.