Skip to content

fix: preserve rotated auth tokens when switching accounts - #128

Open
serg-shcherbak wants to merge 4 commits into
Lampese:mainfrom
serg-shcherbak:codex/fix-rotating-auth-tokens
Open

fix: preserve rotated auth tokens when switching accounts#128
serg-shcherbak wants to merge 4 commits into
Lampese:mainfrom
serg-shcherbak:codex/fix-rotating-auth-tokens

Conversation

@serg-shcherbak

Copy link
Copy Markdown

Summary

Prevents ChatGPT logout after switching from account A to B and back. ChatGPT can rotate a refresh token while an account is active; before replacing ~/.codex/auth.json, the switcher now saves the matching live token set and serializes authentication changes so a late refresh cannot restore the wrong account.

Scope

This is intentionally limited to credential persistence and authentication-operation ordering. It does not add a background refresh loop, re-authentication UI, app restart behavior, localization, or a general account-store worker.

Related work

Test plan

  • cargo test --manifest-path src-tauri/Cargo.toml — 37 passed.
  • pnpm build.
  • Repeated A → B → A switching in a local macOS build; opening chats stayed signed in.

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.

1 participant