fix: set explicit SameSite=Lax on auth cookies#444
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
- Summary
The JWT cookies set by
/tokenand cleared on logout had no SameSite attribute, so we were leaning on the browser default of Lax. Setting it explicitly to Lax in code keeps behaviour stable across browsers and matches how we already pin Secure and HttpOnly. Nothing changes for users.- Test plan
go build ./...andgo vet ./...pass.TestSetCookieTokenSameSiteandTestClearCookieTokenSameSitethat exercise the cookie helpers directly and assert the cookie carriesSameSite=Lax. Both pass locally.- Description for the changelog
Set explicit
SameSite=Laxon auth cookies.