Blitz and Sprig playing nicely together
See original GitHub issueWe have a form appearing in the footer of our site (so on every page). The site uses Blitz to cache the site and we are trialling sprig to load in the form component as well as handle the form responses.
The issue we are having is that the CSRF token that sprig is generating is being rejected.
For example, our page footer:
{{ sprig('/_components/newsletter/sign-up-mailchimp') }}
{{ sprig.script }}
Then our form code (stripped back/simplified):
<form sprig s-action="mud-module/default/mailchimp-subscribe" s-method="POST">
{{ craft.blitz.getUri('/actions/snaptcha/field/get-field') }}
<input type="text" name="email" required />
<input type="submit" value="Submit" />
</form>
The error message is 400 Unable to verify your data submission
implying an invalid CSRF token is being submitted.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
Sprig Plantar/Relationships - Disney Wiki - Fandom
They often played together (often making practical jokes or ambush the other) and were occasional sparring partners. Their relationship has been very mutual, ......
Read more >News and Announcements Archives — Sprig Learning
For many reasons, 2022 was a fantastic year for Sprig Learning. Sprig is better equipped than ever to address the early learning issues...
Read more >Amphibia - Sprig and Ivy moments - YouTube
Sprigivy is the romantic pairing between Ivy Sundew and Sprig Plantar.Episodes:"Dating Season" - While walking in the woods, Anne and Sprig ...
Read more >Sprig Cookbook - PutYourLightsOn
Sprig allows you to create reactive components from Twig templates. ... Blitz. Load another. {# Passes a variable called `limit` into the component ......
Read more >Sprig Taps Celebrity Chefs For Its On-Demand Dinner Service
Brioza's recipes will make up Sprig's first celebrity chef menu, ... and we worked on the recipes together to meet specifications.”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure what your use-case is, but it should be noted that the format for this changed in version 1.0.0-beta.11 (https://github.com/putyourlightson/craft-sprig/blob/develop/CHANGELOG.md#100-beta11---2020-08-18).
This works in my local tests:
Can you please double check that you are running 1.0.0-beta.13 which contains the following lines: https://github.com/putyourlightson/craft-sprig/blob/1.0.0-beta.13/src/services/ComponentsService.php#L171-L173