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

How do I submit the reCaptcha token via AJAX api? #2089

Open
benfeather opened this issue Oct 11, 2024 · 1 comment
Open

How do I submit the reCaptcha token via AJAX api? #2089

benfeather opened this issue Oct 11, 2024 · 1 comment
Labels

Comments

@benfeather
Copy link

Question

What is the correct format to submit the client-side reCaptcha token (v3 Enterprise) using the JS API?

I have the form submission working using the format listed here. But the submission is always marked as spam with the error "Failed Captcha 'Recaptcha': 'Client-side token missing.'"

{
    action: 'formie/submissions/submit',
    handle: 'contactForm',
    siteId: 1,
    fields: {
        yourName: 'Peter Sherman',
        emailAddress: '[email protected]',
        message: 'Hello there!',
    },
};

Additional context

No response

@engram-design
Copy link
Member

If you include a g-recaptcha-response value which is the standard POST param, that should do the trick.

{
    action: 'formie/submissions/submit',
    handle: 'contactForm',
    siteId: 1,
    'g-recaptcha-response': 'xxxxxxxxxx',
    fields: {
        yourName: 'Peter Sherman',
        emailAddress: '[email protected]',
        message: 'Hello there!',
    },
};

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

No branches or pull requests

2 participants