mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Enhance client reload process with new OpenAI compatibility support
- Added handling for OpenAI-compatible providers during client reload. - Implemented client unregistration for old clients during reload. - Improved logging for detailed client reload insights. Expand `AuthDir` handling to support tilde (`~`) for home directory resolution - Added logic to replace `~` with the user's home directory in `AuthDir`. - Prevents errors when using `~` in configuration paths.
This commit is contained in:
@@ -343,6 +343,10 @@ func (c *ClaudeClient) SaveTokenToFile() error {
|
||||
// - error: An error if the refresh operation fails, nil otherwise.
|
||||
func (c *ClaudeClient) RefreshTokens(ctx context.Context) error {
|
||||
// Check if we have a valid refresh token
|
||||
if c.apiKeyIndex != -1 {
|
||||
return fmt.Errorf("no refresh token available")
|
||||
}
|
||||
|
||||
if c.tokenStorage == nil || c.tokenStorage.(*claude.ClaudeTokenStorage).RefreshToken == "" {
|
||||
return fmt.Errorf("no refresh token available")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user