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

Fix CSRF when CSRF_USE_SESSIONS is enabled #619

Merged
merged 2 commits into from
May 22, 2024

Conversation

cpmsmith
Copy link
Contributor

The front-end currently checks for the input[name="csrfmiddlewaretoken"] element if CSRF_COOKIE_HTTPONLY is set, but according to the Django docs, it should do the same thing if CSRF_USE_SESSIONS is set, as it will also mean the token is not available in a cookie.

The front-end currently checks for the
`input[name="csrfmiddlewaretoken"]` element if `CSRF_COOKIE_HTTPONLY` is
set, but according to the [Django docs], it should do the same thing if
`CSRF_USE_SESSIONS` is set, as it will also mean the token is not
available in a cookie.

[Django docs]: https://docs.djangoproject.com/en/5.0/howto/csrf/#acquiring-the-token-if-csrf-use-sessions-or-csrf-cookie-httponly-is-true
@chrisclark
Copy link
Collaborator

Thanks! I will get it reviewed and merged into the next release.

@chrisclark chrisclark merged commit 1d30c93 into explorerhq:master May 22, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants