summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useAuthCommand.ts
diff options
context:
space:
mode:
authorJacob Richman <[email protected]>2025-08-20 12:49:15 -0700
committerGitHub <[email protected]>2025-08-20 19:49:15 +0000
commit52e340a11bc6c9ca10674799fa784566d4bbd538 (patch)
treebfe028836c7c861d83cb445242ada8b46b02869b /packages/cli/src/ui/hooks/useAuthCommand.ts
parentfd64d89da03840802c4d39b01a5915207514d29c (diff)
Revert "Ignore workspace settings for untrusted folders" (#6672)
Diffstat (limited to 'packages/cli/src/ui/hooks/useAuthCommand.ts')
-rw-r--r--packages/cli/src/ui/hooks/useAuthCommand.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/cli/src/ui/hooks/useAuthCommand.ts b/packages/cli/src/ui/hooks/useAuthCommand.ts
index b92fe604..e57a11af 100644
--- a/packages/cli/src/ui/hooks/useAuthCommand.ts
+++ b/packages/cli/src/ui/hooks/useAuthCommand.ts
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { useState, useCallback, useEffect, useContext } from 'react';
+import { useState, useCallback, useEffect } from 'react';
import { LoadedSettings, SettingScope } from '../../config/settings.js';
import {
AuthType,
@@ -13,7 +13,6 @@ import {
getErrorMessage,
} from '@google/gemini-cli-core';
import { runExitCleanup } from '../../utils/cleanup.js';
-import { SettingsContext } from '../contexts/SettingsContext.js';
export const useAuthCommand = (
settings: LoadedSettings,
@@ -23,7 +22,6 @@ export const useAuthCommand = (
const [isAuthDialogOpen, setIsAuthDialogOpen] = useState(
settings.merged.selectedAuthType === undefined,
);
- const settingsContext = useContext(SettingsContext);
const openAuthDialog = useCallback(() => {
setIsAuthDialogOpen(true);
@@ -58,7 +56,7 @@ export const useAuthCommand = (
if (authType) {
await clearCachedCredentialFile();
- settingsContext?.settings.setValue(scope, 'selectedAuthType', authType);
+ settings.setValue(scope, 'selectedAuthType', authType);
if (
authType === AuthType.LOGIN_WITH_GOOGLE &&
config.isBrowserLaunchSuppressed()
@@ -77,7 +75,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
setIsAuthDialogOpen(false);
setAuthError(null);
},
- [settingsContext, setAuthError, config],
+ [settings, setAuthError, config],
);
const cancelAuthentication = useCallback(() => {