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

Pass CSRF token directly as configuration, don't rely on presence of cookie or hidden input #15

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

nijel
Copy link
Contributor

@nijel nijel commented Aug 1, 2024

This works if I manually modify JavaScript, but I have no knowledge of typescript, so there might be something missing.

Fixes #14

nijel and others added 2 commits August 2, 2024 12:02
@Stormheg
Copy link
Member

Stormheg commented Aug 2, 2024

@nijel while reviewing this PR the thought occurred to me: why don't we pass the token directly as configuration? Avoids the need to go looking for it in different places and it assures the token is always available.

What do you think? I've pushed a commit to your branch that implements this.

@nijel
Copy link
Contributor Author

nijel commented Aug 2, 2024

Great idea. That avoids dependency on the Django configuration and page content.

@Stormheg Stormheg changed the title Support fetching csrf token from input Pass CSRF token directly as configuration, don't rely on presence of cookie or hidden input Aug 2, 2024
@Stormheg Stormheg merged commit bd99bab into Stormbase:main Aug 2, 2024
Stormheg added a commit that referenced this pull request Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible with CSRF_USE_SESSIONS = True
2 participants