Fix login for internal employees (#2528)

This PR:
- fixes for internal employee because we currently want to prefer SIWC
for them.
- fixes retrying forever on unauthorized access. we need to break
eventually on max retries.
This commit is contained in:
Ahmed Ibrahim authored and GitHub committed 2025-08-20 14:05:20 -07:00
1 parent 0d12380c3b
commit c579ae41ae
3 files changed
+25 -9

No files matched your search

+1 -1
View File
@@ -242,7 +242,7 @@ fn load_auth(
// "refreshable" even if we are using the API key for auth?
match &tokens {
Some(tokens) => {
if tokens.should_use_api_key(preferred_auth_method) {
if tokens.should_use_api_key(preferred_auth_method, tokens.is_openai_email()) {
return Ok(Some(CodexAuth::from_api_key(api_key)));
} else {
// Ignore the API key and fall through to ChatGPT auth.