mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 13:00: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.
This commit is contained in:
@@ -434,3 +434,8 @@ func (c *GeminiClient) GetUserAgent() string {
|
||||
func (c *GeminiClient) GetRequestMutex() *sync.Mutex {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *GeminiClient) RefreshTokens(ctx context.Context) error {
|
||||
// API keys don't need refreshing
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user