Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reCaptcha doesn't work with the attachment field #570

Open
01Kuzma opened this issue May 30, 2022 · 0 comments
Open

reCaptcha doesn't work with the attachment field #570

01Kuzma opened this issue May 30, 2022 · 0 comments

Comments

@01Kuzma
Copy link

01Kuzma commented May 30, 2022

Hi,
tired of spam I've been trying to implement the Captcha v3 verification with the already working AJAX form.
And I've observed that reCaptcha doesn't work with the attachment field.
I've created a more simplified form as an example:

title: Contact
form:
    name: contact-form
    fields:
        name:
            label: Name
            placeholder: 'Enter your name'
            autocomplete: 'off'
            type: text
            validate:
                required: true
        email:
            label: Email
            placeholder: 'Enter your email address'
            type: email
            validate:
                required: true
        phoneNumber:
            label: 'Phone number'
            placeholder: 'Enter your phone number address'
            type: tel
            validate:
                required: false
        my-file:
            type: file
            multiple: true
            limit: 5
            filesize: 6
            destination: user/data/files
            accept:
                - application/pdf
                - application/x-pdf
                - 'image/*'
                - '.doc, .docx, .pdf, .xls, .xlsx'
                - 'application/msword,'
                - application/vnd.openxmlformats-officedocument.wordprocessingml.document
                - application/vnd.ms-excel
                - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
        g-recaptcha-response:
            type: captcha
            label: Captcha
            recaptcha_not_validated: 'Captcha is not valid'
    buttons:
        submit:
            type: submit
            value: Submit
            classes: primary-button
    process:
        captcha: true
        email:
            from: '{{ config.plugins.email.from }}'
            to: '{{ config.plugins.email.to }}'
            subject: 'some message'
            body: '{% include ''forms/data.html.twig'' %}'
            attachments:
                - my-file

reCaptcha v3 keys are set in form settings.
Grav v1.7.33
Form v6.0.3

Once the g-recaptcha-response: field is added these errors arise:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant