-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(toolbar): Return the CSRF token into the toolbar auth flow for use #106059
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
Conversation
We need the csrf token so the toolbar can make POST/PUT requests and make the toolbar read/write.
…t by django in the response phase, after this view has finished.
| document.cookie = getCookieValue(cookie, window.location.hostname); | ||
| log('Saved a cookie', document.cookie.indexOf(cookie) >= 0); | ||
| } | ||
| if (csrfToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log if csrf token isn't found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also important is handling it on the UI side so things gracefully degrade.
There's no Sentry on this page now afaik, we'd need to load in from the CDN, so i'll take that as a followup for this whole html template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we're relying on middleware... so i think the odds of not having it are low. unless it's misconfigured for this page.
We need the csrf token so the toolbar can make POST/PUT requests and make the toolbar read/write.