diff options
Diffstat (limited to 'packages/core/src/code_assist')
| -rw-r--r-- | packages/core/src/code_assist/oauth2.test.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/code_assist/oauth2.ts | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/packages/core/src/code_assist/oauth2.test.ts b/packages/core/src/code_assist/oauth2.test.ts index 8a1af056..ee63c02b 100644 --- a/packages/core/src/code_assist/oauth2.test.ts +++ b/packages/core/src/code_assist/oauth2.test.ts @@ -38,6 +38,7 @@ vi.mock('../utils/browser.js', () => ({ const mockConfig = { getNoBrowser: () => false, getProxy: () => 'http://test.proxy.com:8080', + isBrowserLaunchSuppressed: () => false, } as unknown as Config; // Mock fetch globally @@ -180,6 +181,7 @@ describe('oauth2', () => { const mockConfigWithNoBrowser = { getNoBrowser: () => true, getProxy: () => 'http://test.proxy.com:8080', + isBrowserLaunchSuppressed: () => true, } as unknown as Config; const mockCodeVerifier = { diff --git a/packages/core/src/code_assist/oauth2.ts b/packages/core/src/code_assist/oauth2.ts index 51227086..5958625a 100644 --- a/packages/core/src/code_assist/oauth2.ts +++ b/packages/core/src/code_assist/oauth2.ts @@ -26,7 +26,6 @@ import { clearCachedGoogleAccount, } from '../utils/user_account.js'; import { AuthType } from '../core/contentGenerator.js'; -import { shouldAttemptBrowserLaunch } from '../utils/browser.js'; import readline from 'node:readline'; // OAuth Client ID used to initiate OAuth2Client class. @@ -122,7 +121,7 @@ export async function getOauthClient( } } - if (config.getNoBrowser() || !shouldAttemptBrowserLaunch()) { + if (config.isBrowserLaunchSuppressed()) { let success = false; const maxRetries = 2; for (let i = 0; !success && i < maxRetries; i++) { |
