mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat(auth): Enhance Gemini web auth with flexible input and UI
This commit is contained in:
@@ -128,6 +128,7 @@ func (a *Auth) AccountInfo() (string, string) {
|
||||
if a == nil {
|
||||
return "", ""
|
||||
}
|
||||
// For Gemini Web, prefer explicit cookie label for stability.
|
||||
if strings.ToLower(a.Provider) == "gemini-web" {
|
||||
// Prefer explicit label written into auth file (e.g., gemini-web-<hash>)
|
||||
if a.Metadata != nil {
|
||||
@@ -145,6 +146,22 @@ func (a *Auth) AccountInfo() (string, string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// For Gemini CLI, include project ID in the OAuth account info if present.
|
||||
if strings.ToLower(a.Provider) == "gemini-cli" {
|
||||
if a.Metadata != nil {
|
||||
email, _ := a.Metadata["email"].(string)
|
||||
email = strings.TrimSpace(email)
|
||||
if email != "" {
|
||||
if p, ok := a.Metadata["project_id"].(string); ok {
|
||||
p = strings.TrimSpace(p)
|
||||
if p != "" {
|
||||
return "oauth", email + " (" + p + ")"
|
||||
}
|
||||
}
|
||||
return "oauth", email
|
||||
}
|
||||
}
|
||||
}
|
||||
if a.Metadata != nil {
|
||||
if v, ok := a.Metadata["email"].(string); ok {
|
||||
return "oauth", v
|
||||
|
||||
Reference in New Issue
Block a user