mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-31 11:01:36 +08:00
Default Codex auth preservation to off (opt-in)
Flip preserve_codex_official_auth_on_switch from true to false so third-party Codex switches overwrite auth.json by default, matching the expectation that switching providers also swaps credentials. Users who rely on keeping the ChatGPT login in auth.json while on a third-party provider (for official plugins / remote login) can enable it in Settings -> Codex Authentication. The toggle field ships for the first time here (it is not in v3.16.0), so no existing settings.json holds an explicit value -- every user lands on the new default and no migration is required. Also set the flag explicitly in the preservation unit test instead of relying on the global default, keeping it valid now that the default is false.
This commit is contained in:
@@ -2560,6 +2560,11 @@ mod tests {
|
||||
fn codex_custom_provider_live_write_preserves_oauth_auth_json() {
|
||||
let _home = TempHome::new();
|
||||
crate::settings::reload_settings().expect("reload settings");
|
||||
crate::settings::update_settings(crate::settings::AppSettings {
|
||||
preserve_codex_official_auth_on_switch: true,
|
||||
..Default::default()
|
||||
})
|
||||
.expect("enable Codex official auth preservation");
|
||||
|
||||
let db = Arc::new(Database::memory().expect("init db"));
|
||||
let service = ProxyService::new(db);
|
||||
@@ -2635,6 +2640,9 @@ wire_api = "responses"
|
||||
live_config.contains(PROXY_TOKEN_PLACEHOLDER),
|
||||
"live config should carry the proxy placeholder token"
|
||||
);
|
||||
|
||||
crate::settings::update_settings(crate::settings::AppSettings::default())
|
||||
.expect("reset settings");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user