mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 09:55:54 +03:00
[GH-ISSUE #59] gemini-cli-oauth方式下,GeminiApiService的initializeAuth()逻辑是不是有问题 #49
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @airlulu on GitHub (Sep 29, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/59
v1.0.0
在异常捕获块中才会走getNewToken()的浏览器授权过程,也就是说如果想走浏览器授权方式,要给启动参数--gemini-oauth-creds-file传入一个不存在的凭证文件?
不知道我理解对不对,我是分析完代码,然后通过上面的方式才成功使用~
@justlovemaki commented on GitHub (Sep 30, 2025):
const credPath = this.oauthCredsFilePath || path.join(os.homedir(), CREDENTIALS_DIR, CREDENTIALS_FILE);
这个逻辑不是说先看oauthCredsFilePath是否有值 ,没有再从默认路径读取吗?你是配置文件oauthCredsFilePath有值吧?启动参数参数优先级更高,所以才能成功。