Interface VerificationOptions<TUser>

The VerificationManager options.

Export

VerificationOptions

interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

codeGenerationOptions: {
    charactersWhitelist?: string;
    length: number;
}

The options related to the code generation.

Type declaration

  • Optional charactersWhitelist?: string

    The whitelist of characters used to generate the code.

  • length: number

    The required length of the code.

Memberof

VerificationOptions

maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

Memberof

VerificationOptions

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

  • Formats the message sent when calling the communication service throws an error.

    Parameters

    • user: TUser
    • error: unknown

    Returns string

    the message

    Memberof

    VerificationOptions

  • Formats the message sent once the code is checked and invalid.

    Parameters

    • user: undefined | null | TUser
    • invalidCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

  • Formats the message sent for the first time when the user's code has just been sent.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

  • Formats the message sent once the code is checked and valid.

    Parameters

    • user: undefined | null | TUser
    • validCode: string

    Returns string

    the message

    Memberof

    VerificationOptions