fix: prevent claude-cli oauth downgrade (#654) (thanks @radek-paclt)

This commit is contained in:
Peter Steinberger
2026-01-10 15:50:25 +01:00
parent a39951d463
commit 5a93447294
3 changed files with 59 additions and 1 deletions

View File

@@ -716,6 +716,11 @@ function syncExternalCliCredentials(
}
}
// Avoid downgrading from oauth to token-only credentials.
if (existing?.type === "oauth" && claudeCreds.type === "token") {
shouldUpdate = false;
}
if (shouldUpdate && !isEqual) {
store.profiles[CLAUDE_CLI_PROFILE_ID] = claudeCreds;
mutated = true;