Skip to content

Commit 626aba3

Browse files
committed
fix: prefer active codex provider api key
1 parent a1bc64e commit 626aba3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

server/providers/codex/status.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ function getConfiguredProviderApiKey(configContent) {
8989
}
9090

9191
async function checkCredentials() {
92-
if (typeof process.env.CODEX_API_KEY === 'string' && process.env.CODEX_API_KEY.trim()) {
92+
const config = await loadCodexConfig();
93+
const configuredProviderApiKey = getConfiguredProviderApiKey(config);
94+
if (configuredProviderApiKey) {
9395
return { authenticated: true, email: 'API Key Auth', method: 'api_key' };
9496
}
9597

96-
if (typeof process.env.OPENAI_API_KEY === 'string' && process.env.OPENAI_API_KEY.trim()) {
98+
if (typeof process.env.CODEX_API_KEY === 'string' && process.env.CODEX_API_KEY.trim()) {
9799
return { authenticated: true, email: 'API Key Auth', method: 'api_key' };
98100
}
99101

100-
const config = await loadCodexConfig();
101-
const configuredProviderApiKey = getConfiguredProviderApiKey(config);
102-
if (configuredProviderApiKey) {
102+
if (typeof process.env.OPENAI_API_KEY === 'string' && process.env.OPENAI_API_KEY.trim()) {
103103
return { authenticated: true, email: 'API Key Auth', method: 'api_key' };
104104
}
105105

0 commit comments

Comments
 (0)