From b49d55584e67d0f147fb0b7e3c9526c2e2ed5ad9 Mon Sep 17 00:00:00 2001 From: Tommaso Sciortino Date: Wed, 18 Jun 2025 17:24:46 -0700 Subject: Use Env Var directly instead of through GoogleAuth() (#1202) --- packages/core/src/code_assist/codeAssist.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'packages/core/src/code_assist/codeAssist.ts') diff --git a/packages/core/src/code_assist/codeAssist.ts b/packages/core/src/code_assist/codeAssist.ts index 92b53104..4b46f8b9 100644 --- a/packages/core/src/code_assist/codeAssist.ts +++ b/packages/core/src/code_assist/codeAssist.ts @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { GoogleAuth, AuthClient } from 'google-auth-library'; import { ContentGenerator } from '../core/contentGenerator.js'; import { getOauthClient } from './oauth2.js'; import { setupUser } from './setup.js'; @@ -13,17 +12,7 @@ import { CodeAssistServer, HttpOptions } from './server.js'; export async function createCodeAssistContentGenerator( httpOptions: HttpOptions, ): Promise { - const authClient = await getAuthClient(); + const authClient = await getOauthClient(); const projectId = await setupUser(authClient); return new CodeAssistServer(authClient, projectId, httpOptions); } - -async function getAuthClient(): Promise { - try { - // Try for Application Default Credentials. - return await new GoogleAuth().getClient(); - } catch (_) { - // No Application Default Credentials so try Oauth. - return await getOauthClient(); - } -} -- cgit v1.2.3