feat(gemini-web): Implement proactive PSIDTS cookie rotation

This commit is contained in:
hkfires
2025-09-22 21:54:52 +08:00
parent ed87dda0a6
commit 22a69333a0
5 changed files with 86 additions and 41 deletions

View File

@@ -861,7 +861,11 @@ func (m *Manager) refreshAuth(ctx context.Context, id string) {
if updated == nil {
updated = cloned
}
updated.Runtime = auth.Runtime
// Preserve runtime created by the executor during Refresh.
// If executor didn't set one, fall back to the previous runtime.
if updated.Runtime == nil {
updated.Runtime = auth.Runtime
}
updated.LastRefreshedAt = now
updated.NextRefreshAfter = time.Time{}
updated.LastError = nil

View File

@@ -133,6 +133,7 @@ var defaultAuthenticatorFactories = map[string]func() clipauth.Authenticator{
"qwen": func() clipauth.Authenticator { return clipauth.NewQwenAuthenticator() },
"gemini": func() clipauth.Authenticator { return clipauth.NewGeminiAuthenticator() },
"gemini-cli": func() clipauth.Authenticator { return clipauth.NewGeminiAuthenticator() },
"gemini-web": func() clipauth.Authenticator { return clipauth.NewGeminiWebAuthenticator() },
}
var expireKeys = [...]string{"expired", "expire", "expires_at", "expiresAt", "expiry", "expires"}