We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We are getting "Invalid csrf token" when we have some javascript in our django templates in our wagtail project
does an async fetch POST cause issues with wagtail caching and csrf tokens ie
return await fetch(${submitAPIEndpoint}?js_enabled=True, { method: 'POST', headers: { 'Content-Type': "application/json", 'X-CSRFToken': csrfToken }, body: JSON.stringify(body) })
${submitAPIEndpoint}?js_enabled=True
The text was updated successfully, but these errors were encountered:
Question: do you have a valid CSRF token on the page? I'd recommend setting it in a script tag using the Django template as so:
<script> csrfToken = "{% csrf_token %}"; </script>
Sorry, something went wrong.
No branches or pull requests
We are getting "Invalid csrf token" when we have some javascript in our django templates in our wagtail project
does an async fetch POST cause issues with wagtail caching and csrf tokens ie
return await fetch(
${submitAPIEndpoint}?js_enabled=True
, {method: 'POST',
headers: {
'Content-Type': "application/json",
'X-CSRFToken': csrfToken
},
body: JSON.stringify(body)
})
The text was updated successfully, but these errors were encountered: