default: {
    getCaptcha(
        req: Request,
        formKey?: string,
    ): { captcha: any; id: string; placeholder: string; question: string };
    getQuestionCaptcha(
        formKey?: string,
    ): { captcha: Record<string, unknown>; id: number };
    processCaptchaAnswer(req: Request): boolean;
} = ...

Type declaration

  • getCaptcha:function
    • Retrieve the configured captcha metadata for a form, if present.

      Parameters

      • req: Request

        Request used to localize the captcha text

      • OptionalformKey: string

        Identifier for the form to look up configuration

      Returns { captcha: any; id: string; placeholder: string; question: string }

  • getQuestionCaptcha:function
    • Provide a random question captcha when the legacy flow is enabled.

      Parameters

      • OptionalformKey: string

        Identifier for the form requesting captcha data

      Returns { captcha: Record<string, unknown>; id: number }

  • processCaptchaAnswer:function
    • Validate the answer for a simple question captcha.

      Missing answers rely on required field validation and therefore do not emit additional flash messages here.

      Parameters

      • req: Request

      Returns boolean