Skip to content

fix: enhance refresh token lifecycle management - #144

Merged
Dejmenek merged 12 commits into
mainfrom
fix/108-refresh-tokens-no-reusetheft-detection-rotation-isnt-concurrency-guarded-and-login-kills-all-other-sessions
Sep 14, 2026
Merged

Dejmenek merged 12 commits into
mainfrom
fix/108-refresh-tokens-no-reusetheft-detection-rotation-isnt-concurrency-guarded-and-login-kills-all-other-sessions

Conversation

@Dejmenek

Copy link
Copy Markdown
Owner

Summary

This pull request enhances the authentication system by improving refresh token lifecycle management, adding robust logout functionality, and addressing concurrency issues.

Changes

  • RefreshToken model: Refactored to include Expires, Created, Revoked, and ReplacedByToken fields, with IsActive and concurrency control via [Timestamp].
  • UserMutationTests.cs: Added test cases for token reuse, concurrent operations, and logout scenarios.
  • UserMutations.cs: Enhanced LogoutUser and RefreshToken mutations to handle token revocation, reuse detection, and concurrency.
  • HttpResponseExtensions.cs: Added ClearRefreshTokenCookie method for clearing cookies during logout.
  • UserErrors.cs and UserErrorCodes.cs: Introduced new error codes/messages for token conflicts, reuse, and HTTP context issues.

@Dejmenek
Dejmenek merged commit 01e9034 into main Sep 14, 2026
3 checks passed
@Dejmenek
Dejmenek deleted the fix/108-refresh-tokens-no-reusetheft-detection-rotation-isnt-concurrency-guarded-and-login-kills-all-other-sessions branch September 14, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh tokens: no reuse/theft detection, rotation isn't concurrency-guarded, and login kills all other sessions

1 participant