Closed robdekort closed 9 months ago
BTW I also have a site on production I could add you to, so you can play around with the issue.
You need to add the X-CSRF-TOKEN
header in your javascript if you're submitting via ajax.
Looks like you removed that when you refactored to precognition.
Seems I got myself into way more trouble than I should've. I figured it would use the hidden _token
field when the form got submitted. I'll look into it. Thanks Jason.
The $form helper does seem to submit the token. I took the submission snippet straight from the Precognition docs.
Bug description
I recently switched to precognition for forms and form submission. Therefore I deleted all custom CSRF token stuff I used to have when submitting forms using
fetch()
as I was under the impression Statamic handles that these days. Unfortunately on production with static caching I get a 419 error in the console when the token expires.How to reproduce
Logs
No response
Environment
Installation
Starter Kit using via CLI
Antlers Parser
None
Additional details
No response