mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Refactor the logic for deciding whether to launch a browser into config (#4622)
This commit is contained in:
committed by
GitHub
parent
97cf26ec53
commit
5066bc5384
@@ -37,7 +37,6 @@ import {
|
||||
logUserPrompt,
|
||||
AuthType,
|
||||
getOauthClient,
|
||||
shouldAttemptBrowserLaunch,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { validateAuthMethod } from './config/auth.js';
|
||||
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
|
||||
@@ -188,7 +187,7 @@ export async function main() {
|
||||
|
||||
if (
|
||||
settings.merged.selectedAuthType === AuthType.LOGIN_WITH_GOOGLE &&
|
||||
(config.getNoBrowser() || !shouldAttemptBrowserLaunch())
|
||||
config.isBrowserLaunchSuppressed()
|
||||
) {
|
||||
// Do oauth before app renders to make copying the link possible.
|
||||
await getOauthClient(settings.merged.selectedAuthType, config);
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
Config,
|
||||
clearCachedCredentialFile,
|
||||
getErrorMessage,
|
||||
shouldAttemptBrowserLaunch,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { runExitCleanup } from '../../utils/cleanup.js';
|
||||
|
||||
@@ -60,7 +59,7 @@ export const useAuthCommand = (
|
||||
settings.setValue(scope, 'selectedAuthType', authType);
|
||||
if (
|
||||
authType === AuthType.LOGIN_WITH_GOOGLE &&
|
||||
(config.getNoBrowser() || !shouldAttemptBrowserLaunch())
|
||||
config.isBrowserLaunchSuppressed()
|
||||
) {
|
||||
runExitCleanup();
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user