diff options
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(() => { |
