Repository navigation
Revoke only the replayed sign-in on refresh token reuse - #457
Merged
Merged
Conversation
A rotated refresh token presented again made the OAuth provider delete every token the user held for that client. A browser session copied into a second cookie store, such as an app added to the iOS Home Screen, then signed the user out of all devices once one copy rotated. The provider patch now limits that teardown to the tokens issued from the same authorization code, in the refresh and both revocation paths. Tokens without an authorization code, such as device grants, keep the teardown of all of the user's tokens for that client.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 62520d5 | Nov 27 2026, 11:57 PM |
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.
Problem
Better Auth rotates refresh tokens. When a rotated token is presented again after the reuse window, the OAuth provider deletes every refresh token the user holds for that client.
A browser session can end up in two cookie stores. For example, iOS copies a site's cookies into an app added to the Home Screen. Once one copy rotates, the other presents the old token. The user is then signed out of every app sign-in on all devices.
Change
Tests
organization-sso.integration.test.tscovers:Without the patch, the new app sign-in test fails.