mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 22:44:45 -07:00
fix(auth): improve API key authentication flow (#13829)
This commit is contained in:
@@ -116,6 +116,9 @@ export function AuthDialog({
|
||||
return;
|
||||
}
|
||||
if (authType) {
|
||||
const isInitialAuthSelection =
|
||||
!settings.merged.security?.auth?.selectedType;
|
||||
|
||||
await clearCachedCredentialFile();
|
||||
|
||||
settings.setValue(scope, 'security.auth.selectedType', authType);
|
||||
@@ -130,10 +133,16 @@ export function AuthDialog({
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (authType === AuthType.USE_GEMINI) {
|
||||
setAuthState(AuthState.AwaitingApiKeyInput);
|
||||
return;
|
||||
|
||||
if (authType === AuthType.USE_GEMINI) {
|
||||
if (isInitialAuthSelection && process.env['GEMINI_API_KEY']) {
|
||||
setAuthState(AuthState.Unauthenticated);
|
||||
return;
|
||||
} else {
|
||||
setAuthState(AuthState.AwaitingApiKeyInput);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
setAuthState(AuthState.Unauthenticated);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user