CSRF Verification Failed on Login with Google (Intermittent Issue)
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
### Environment
SaaS ([https://sentry.io/]())
### Steps to Reproduce
When attempting to log into Sentry using "Login with Google," the customer intermittently receives a "CSRF verification failed" error. However, after refreshing the page, they are successfully logged in. The issue does not occur consistently.
* Go to the Sentry login page.
* Click on "Login with Google.
* Complete the authentication flow (including any 2FA if enabled).
* Sometimes, after authentication, a "CSRF verification failed" error appears instead of being logged in directly.-
* Refreshing the page after seeing the error results in successful login.
Browsers tested:
Google Chrome Version 133.0.6943.142 (Official Build) (arm64)
Firefox 136.0 (aarch64)
### Expected Result
After logging in with Google, the user should be redirected to the Sentry dashboard without encountering a CSRF verification error.
### Actual Result
An intermittent CSRF verification error occurs after Google authentication, but the login is still successful upon refreshing the page.
### Product Area
Sign In
### Link
*No response*
### DSN
*No response*
### Version
*No response*
Contributor guide
Research direction
No file, test, or entry point is identified. Start by reproducing the Google login flow in the reported Chrome and Firefox environments, then trace the sign-in path around the intermittent CSRF failure and the successful refresh. Done means Google login consistently reaches the Sentry dashboard without the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- authentication, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100