Skip to content

fix: sync active auth before login overwrites it#113

Merged
Loongphy merged 1 commit into
mainfrom
codex/sync-active-auth-before-login
May 21, 2026
Merged

fix: sync active auth before login overwrites it#113
Loongphy merged 1 commit into
mainfrom
codex/sync-active-auth-before-login

Conversation

@Loongphy
Copy link
Copy Markdown
Owner

Problem

codex-auth login runs codex login, which can overwrite the active auth.json with the newly logged-in account. If the previous active account had a recently refreshed token in auth.json that had not yet been synced back to its managed account snapshot, that refreshed token could be lost.

Fix

Load the registry before running codex login and sync the current active auth.json back into the managed snapshot when managed accounts already exist. This preserves any refreshed token before the active auth file is replaced by the new login flow.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@7a0db43

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@7a0db43

@loongphy/codex-auth-linux-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-arm64@7a0db43

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@7a0db43

@loongphy/codex-auth-win32-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-arm64@7a0db43

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@7a0db43

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@7a0db43

commit: 7a0db43

@Loongphy Loongphy merged commit 7fed35e into main May 21, 2026
12 checks passed
@Loongphy Loongphy deleted the codex/sync-active-auth-before-login branch May 21, 2026 06:04
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