@auth0/auth0-acul-react - v1.11.0
    Preparing search index...

    Type Alias MfaPollingOptions

    Configuration options for managing a polling process on a screen that waits for an out-of-band decision, such as an MFA push challenge or a pending consent.

    Supply these options when starting a polling session to control how often the screen is polled and how success or failure is handled.

    type MfaPollingOptions = {
        intervalMs?: number;
        onCompleted?: () => void;
        onError?: (error: Error) => void;
    }
    Index

    Properties

    intervalMs?: number

    Optional interval, in milliseconds, between consecutive polling requests.

    • If omitted, the SDK’s internal default interval is used (typically 5000 ms).
    • Choose a value that balances responsiveness with rate-limit considerations.
    Implementation-specific (commonly 5000 ms)
    
    onCompleted?: () => void

    Optional callback executed once the server reports the polled request as completed, whether it was approved or denied (for example, an MFA push challenge or a pending consent).

    • Called exactly once, after which polling stops automatically.
    • Useful for advancing the login flow (e.g., calling continue()), which lets Auth0 apply the outcome.
    onError?: (error: Error) => void

    Optional callback invoked if an error occurs while polling.

    Receives an ULError object containing:

    • code — polling_error_<status> for a non-200/429 response, or polling_network_error for a network failure

    • message — for a network failure, a generic message. Otherwise the message field of a JSON error body if it has one, else the raw response text, or Polling error (<status>) if the body is empty. The raw text can be HTML or JSON (Auth0's own error body has no message field), so log it rather than showing it to users.

    • Polling stops after an error and does not retry.

    • HTTP 429 (rate limit) responses are not errors: polling waits until the rate limit resets and then retries.

    • Use to surface error messages or offer a manual way to continue.