diff options
Diffstat (limited to 'packages/cli/src/ui/hooks/useAuthCommand.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useAuthCommand.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useAuthCommand.ts b/packages/cli/src/ui/hooks/useAuthCommand.ts index afc276c0..e4f1f093 100644 --- a/packages/cli/src/ui/hooks/useAuthCommand.ts +++ b/packages/cli/src/ui/hooks/useAuthCommand.ts @@ -11,6 +11,7 @@ import { Config, clearCachedCredentialFile, getErrorMessage, + shouldAttemptBrowserLaunch, } from '@google/gemini-cli-core'; import { runExitCleanup } from '../../utils/cleanup.js'; @@ -56,7 +57,10 @@ export const useAuthCommand = ( if (authType) { await clearCachedCredentialFile(); settings.setValue(scope, 'selectedAuthType', authType); - if (authType === AuthType.LOGIN_WITH_GOOGLE && config.getNoBrowser()) { + if ( + authType === AuthType.LOGIN_WITH_GOOGLE && + (config.getNoBrowser() || !shouldAttemptBrowserLaunch()) + ) { runExitCleanup(); console.log( ` |
