feat!: implement security improvements for authentication#21
Merged
VanessaBizzell merged 3 commits intomainfrom Feb 12, 2026
Merged
feat!: implement security improvements for authentication#21VanessaBizzell merged 3 commits intomainfrom
VanessaBizzell merged 3 commits intomainfrom
Conversation
BREAKING CHANGES: - Refresh endpoint changed from GET to POST with JSON body - Tokens now returned as httpOnly cookies instead of response body - CSRF protection enabled for state-changing requests Security improvements: - URL-encode email and code parameters in login links - Add input validation for returnUrl in LoginStep1SendVerificationCode - Add httpOnly cookie-based token delivery (SetTokenCookies, ClearTokenCookies) - Add CSRF middleware and SetCSRFCookie helper - Update middleware to support both Authorization header and cookie auth - Add /auth/logout POST endpoint Also fixes pre-existing test failure for RFC 5321-compliant IP literal emails. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reverts accidental change to pre-existing test case. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update go.mod to Go 1.26 - Update CI workflow to use Go 1.26 - Fix email validator test for Go 1.24+ behavior (RFC 5321 IP literals) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
revitteth
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
+in emails)LoginStep1SendVerificationCodenow validates returnUrl against allowed list/auth/refreshchanged from GET to POST with JSON body (breaking change)CSRFMiddlewareandSetCSRFCookiehelper for state-changing requestsPOST /auth/logoutto clear token cookiesVerifyAuthenticationTokennow supports both Authorization header and cookie-based authBreaking Changes
This is a major version release (v3.0.0). Consumers must update their code:
GET /auth/refresh?token=xxx→POST /auth/refreshwith{"token": "xxx"}credentials: 'include'to fetch calls, addX-CSRF-Tokenheader for POST/PUT/DELETETest plan
🤖 Generated with Claude Code