mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
Fix Codex OAuth auth being cleared during preserve-mode takeover
When "preserve official auth on switch" is enabled, proxy takeover routes the PROXY_MANAGED placeholder into config.toml's experimental_bearer_token and leaves auth.json (the ChatGPT OAuth login) untouched. Takeover detection only inspected auth.json's OPENAI_API_KEY, so it never recognized this state and returned a false negative, which led downstream paths to clobber the preserved OAuth login. - Detection: is_codex_live_taken_over now also matches a config.toml experimental_bearer_token equal to the placeholder, fixing detect/cleanup/ restore/startup-recovery in one place. - Cleanup: remove the config.toml bearer token only when it equals the placeholder (new remove_codex_experimental_bearer_token_if predicate), so a real third-party key is never stripped. - Write: under preservation, the None-provider takeover path writes only config.toml and keeps auth.json intact, matching the provider path. - Settings: rename the section to "Codex App Enhancements" and reword the description across all four locales. - Add tests covering OAuth preservation on takeover and placeholder-only cleanup.
This commit is contained in:
@@ -242,11 +242,11 @@ export function SettingsPage({
|
||||
handleAutoSave({ skillSyncMethod: method })
|
||||
}
|
||||
/>
|
||||
<WindowSettings
|
||||
<CodexAuthSettings
|
||||
settings={settings}
|
||||
onChange={handleAutoSave}
|
||||
/>
|
||||
<CodexAuthSettings
|
||||
<WindowSettings
|
||||
settings={settings}
|
||||
onChange={handleAutoSave}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user