mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat(auth): Enhance non-interactive gcp auth (#4811)
This commit is contained in:
@@ -78,6 +78,17 @@ export async function getOauthClient(
|
||||
},
|
||||
});
|
||||
|
||||
if (
|
||||
process.env.GOOGLE_GENAI_USE_GCA &&
|
||||
process.env.GOOGLE_CLOUD_ACCESS_TOKEN
|
||||
) {
|
||||
client.setCredentials({
|
||||
access_token: process.env.GOOGLE_CLOUD_ACCESS_TOKEN,
|
||||
});
|
||||
await fetchAndCacheUserInfo(client);
|
||||
return client;
|
||||
}
|
||||
|
||||
client.on('tokens', async (tokens: Credentials) => {
|
||||
await cacheCredentials(tokens);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user