mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 09:55:54 +03:00
[GH-ISSUE #19] token定期刷新 #17
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#17
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 @mailbyms on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/19
已经打了镜像,Kiro 转API正常
项目代码里好像找不到定期刷新 Kiro accessToken 和 refreshToken 的处理?
@justlovemaki commented on GitHub (Aug 6, 2025):
没做定时刷新,做的是请求时发现过期,先发起刷新再接着请求。
@mailbyms commented on GitHub (Aug 7, 2025):
场景:
aiclient2api 项目用 docker 部署到服务器,提供接口。
因为 kiro 客户端平时不一定打开,当容器的 refreshToken 都失效后,就获取不了 accessToken
方案:
我让kiro帮我实现一个接口 /refresh-kiro-token,如果 token的expireAt在5分钟内,就触发 kiroService.initializeAuth(true); // Force refresh with forceRefresh = true
代码在这里,供参考
github.com/justlovemaki/AIClient-2-API@c814035487同时在 docker-compose.yml 里定义 health-check 每5分钟调用一次 /refresh-kiro-token ,就能让 kiro 的 accessToken 一直有效
完整的 docker-compose.yml
@justlovemaki commented on GitHub (Aug 7, 2025):
不错,提供了思路
@justlovemaki commented on GitHub (Aug 7, 2025):
最新版已包含定时刷新token的逻辑