Skip to content

[login] revoke superseded auth tokens on relogin#21747

Merged
cooper-oai merged 3 commits into
mainfrom
cooper/revoke-superseded-login-tokens
May 11, 2026
Merged

[login] revoke superseded auth tokens on relogin#21747
cooper-oai merged 3 commits into
mainfrom
cooper/revoke-superseded-login-tokens

Conversation

@cooper-oai
Copy link
Copy Markdown
Contributor

Summary

  • revoke previously stored managed ChatGPT tokens after a successful re-login
  • keep the new login successful even when revocation is unavailable or fails
  • cover the shared persistence path used by browser and device-code login flows

Why

A new codex login currently overwrites existing managed ChatGPT credentials without attempting to revoke the superseded tokens, leaving old credentials valid longer than necessary.

Validation

  • just fmt
  • CARGO_HOME=/tmp/cargo-home cargo test -p codex-login

Notes

  • Initial local Cargo validation hit a corrupt existing crate cache in the default CARGO_HOME; rerunning with a clean temporary CARGO_HOME passed.

@cooper-oai cooper-oai marked this pull request as ready for review May 8, 2026 14:50
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc78546c9e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/login/src/server.rs Outdated
@cooper-oai
Copy link
Copy Markdown
Contributor Author

[codex] Local review loop completed for 3b24a654a80edaec40ec89923d3e6d767abe9f79.

  • Backend: local Codex CLI review
  • Result: clean for the current PR diff
  • GitHub Codex Connector review: not requested for the final clean signal

Review findings handled:

Priority Source Finding Disposition Change or Rationale
P1 GitHub Codex Connector Re-login could revoke a refresh token that was reused and just persisted again Addressed Skip revocation when the previously revocable managed token matches the newly stored token; added regression coverage for the reused-refresh-token case.

Proceeding to CI babysitting.

@cooper-oai cooper-oai requested a review from celia-oai May 8, 2026 16:48
Comment thread codex-rs/login/src/server.rs
Comment thread codex-rs/login/src/server.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
cooper-oai and others added 3 commits May 11, 2026 19:56
@cooper-oai cooper-oai force-pushed the cooper/revoke-superseded-login-tokens branch from a58677f to 0c57239 Compare May 11, 2026 19:58
@cooper-oai cooper-oai requested a review from celia-oai May 11, 2026 20:26
@cooper-oai cooper-oai merged commit 54ec99c into main May 11, 2026
26 checks passed
@cooper-oai cooper-oai deleted the cooper/revoke-superseded-login-tokens branch May 11, 2026 20:36
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants