mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 20:40:52 +08:00
Add token refresh handling for 401 responses across clients
- Implemented `RefreshTokens` method in client interfaces and Gemini clients. - Updated handlers to call `RefreshTokens` on 401 responses and retry requests if token refresh succeeds. - Enhanced error handling and retry logic to accommodate token refresh flow. Update README to include Qwen login instructions - Added Qwen OAuth login command instructions in both English and Chinese README files. - Made minor updates to existing command examples for consistency.
This commit is contained in:
@@ -263,6 +263,7 @@ func StartService(cfg *config.Config, configPath string) {
|
||||
for {
|
||||
select {
|
||||
case <-ctxRefresh.Done():
|
||||
log.Debugf("refreshing tokens stopped...")
|
||||
return
|
||||
case <-ticker.C:
|
||||
checkAndRefresh()
|
||||
|
||||
Reference in New Issue
Block a user