You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 183b2bc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(oauth): revoke replaced sessions and preserve token metadata
Clean up replaced OAuth sessions without forcing a re-login when the
required scopes change.
- Insufficient scopes prevent refresh but keep the stored access token, so
normal 401 recovery applies after expiry. Rename the check to
`canRefreshOAuthSession`.
- Save a successful replacement first, then revoke the overwritten OAuth
pair in the background with the client registration captured before
login. Failed or canceled logins, same-token reuse, and stored-session
adoption revoke nothing.
- Keep refresh credentials and scopes when the same token is reused on the
same origin, instead of turning it into a manual-token session. If a
refresh rotates the session while its stored token is checked, keep the
rotated session.
- Share revocation with logout through `withOAuthMetadata`, which token
refresh also uses, and request `user:update_personal` to refresh expired
external-auth links.
- If the server refuses dynamic client registration (off by default from
Coder 2.38), name the setting and offer session-token sign-in.
- Start every CLI invocation's global flags with an empty `--token=`, so
`CODER_SESSION_TOKEN` in the extension host (in any case) no longer
overrides the stored session. This covers the SSH ProxyCommand and
terminals too. `coder login --use-token-as-session` omits it, since it
reads the token from the environment, and gets an environment without
the host's case variants of the variable.
Closes#1140
0 commit comments