mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
Automatically detect non-interactive environments and fall back to a manual, code-based authentication flow (#4475)
This commit is contained in:
parent
003609239f
commit
5b7b6fe608
6 changed files with 73 additions and 8 deletions
|
|
@ -37,6 +37,7 @@ import {
|
|||
logUserPrompt,
|
||||
AuthType,
|
||||
getOauthClient,
|
||||
shouldAttemptBrowserLaunch,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { validateAuthMethod } from './config/auth.js';
|
||||
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
|
||||
|
|
@ -184,7 +185,7 @@ export async function main() {
|
|||
|
||||
if (
|
||||
settings.merged.selectedAuthType === AuthType.LOGIN_WITH_GOOGLE &&
|
||||
config.getNoBrowser()
|
||||
(config.getNoBrowser() || !shouldAttemptBrowserLaunch())
|
||||
) {
|
||||
// Do oauth before app renders to make copying the link possible.
|
||||
await getOauthClient(settings.merged.selectedAuthType, config);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue