diff options
| author | N. Taylor Mullen <[email protected]> | 2025-07-12 15:42:47 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-12 15:42:47 -0700 |
| commit | 4442e893c367a901a4c801816e0ade5b78c291c9 (patch) | |
| tree | a5962bb7e5995e33306bd33635f25f889f5c4b52 /packages/cli/src/ui/hooks/useAuthCommand.ts | |
| parent | 890982a811e22de9525148e6c28f39bfbf10a49a (diff) | |
fix(auth): Remove sharp edges from headless auth (#3985)
Diffstat (limited to 'packages/cli/src/ui/hooks/useAuthCommand.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useAuthCommand.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useAuthCommand.ts b/packages/cli/src/ui/hooks/useAuthCommand.ts index c19a91b6..afc276c0 100644 --- a/packages/cli/src/ui/hooks/useAuthCommand.ts +++ b/packages/cli/src/ui/hooks/useAuthCommand.ts @@ -12,6 +12,7 @@ import { clearCachedCredentialFile, getErrorMessage, } from '@google/gemini-cli-core'; +import { runExitCleanup } from '../../utils/cleanup.js'; export const useAuthCommand = ( settings: LoadedSettings, @@ -55,11 +56,22 @@ export const useAuthCommand = ( if (authType) { await clearCachedCredentialFile(); settings.setValue(scope, 'selectedAuthType', authType); + if (authType === AuthType.LOGIN_WITH_GOOGLE && config.getNoBrowser()) { + runExitCleanup(); + console.log( + ` +---------------------------------------------------------------- +Logging in with Google... Please restart Gemini CLI to continue. +---------------------------------------------------------------- + `, + ); + process.exit(0); + } } setIsAuthDialogOpen(false); setAuthError(null); }, - [settings, setAuthError], + [settings, setAuthError, config], ); const cancelAuthentication = useCallback(() => { |
