-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Environment
- Craft CMS Pro 5.8.17
- Freeform 5.12.2
- Snaptcha latest version
- Tailwind 4 Freeform formatting template
Description
I’m integrating Snaptcha with Freeform. The hidden input field renders correctly ({{ craft.snaptcha.field }}), and the first AJAX form submit works fine.
But when I submit the form again via AJAX (without reloading the page), I consistently get a 400 (Bad Request) error.
POST ... 400 (Bad Request)
Uncaught (in promise) Error: Request failed with status
Expected Behavior
- With One Time Key disabled, I would expect the Snaptcha field to still be valid for multiple submissions until it expires (Expiration Time = 60 minutes).
- A second AJAX submit should succeed without requiring a reload.
Steps to Reproduce
- Render Freeform form with
{{ craft.snaptcha.field }}. - Submit once via AJAX → works.
- Submit again via AJAX (same page, same form) → 400 error.
Notes
- With non-AJAX forms, multiple submissions do work as expected when One Time Key is disabled.
- This suggests the hidden input is being consumed or invalidated after the first AJAX submission.
- Should AJAX workflows fetch a fresh field via
/actions/snaptcha/field/get-fieldafter each submit? Or should the same field value remain valid when One Time Key is off?
Looking for clarification on whether this is intended behavior or if it’s a bug.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request