mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 12:20:52 +08:00
- Deleted `Refresh` implementations in Codex, Claude, Gemini, Qwen, and Gemini-web authenticators. - Updated the `Authenticator` interface to exclude `Refresh` for cleaner design. - Revised `Manager` and related components to handle refresh logic improvements. - Simplified token refresh behavior and eliminated redundant code paths.
30 lines
833 B
Go
30 lines
833 B
Go
package auth
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
|
|
)
|
|
|
|
// GeminiWebAuthenticator provides a minimal wrapper so core components can treat
|
|
// Gemini Web credentials via the shared Authenticator contract.
|
|
type GeminiWebAuthenticator struct{}
|
|
|
|
func NewGeminiWebAuthenticator() *GeminiWebAuthenticator { return &GeminiWebAuthenticator{} }
|
|
|
|
func (a *GeminiWebAuthenticator) Provider() string { return "gemini-web" }
|
|
|
|
func (a *GeminiWebAuthenticator) Login(ctx context.Context, cfg *config.Config, opts *LoginOptions) (*TokenRecord, error) {
|
|
_ = ctx
|
|
_ = cfg
|
|
_ = opts
|
|
return nil, fmt.Errorf("gemini-web authenticator does not support scripted login; use CLI --gemini-web-auth")
|
|
}
|
|
|
|
func (a *GeminiWebAuthenticator) RefreshLead() *time.Duration {
|
|
d := 9 * time.Minute
|
|
return &d
|
|
}
|