Commit fac19d25 authored by shaw's avatar shaw
Browse files

fix(oauth): 修复claude cookie添加账号时会话混淆的问题

parent 70e9329e
...@@ -233,11 +233,17 @@ func (s *claudeOAuthService) RefreshToken(ctx context.Context, refreshToken, pro ...@@ -233,11 +233,17 @@ func (s *claudeOAuthService) RefreshToken(ctx context.Context, refreshToken, pro
} }
func createReqClient(proxyURL string) *req.Client { func createReqClient(proxyURL string) *req.Client {
return getSharedReqClient(reqClientOptions{ // 禁用 CookieJar,确保每次授权都是干净的会话
ProxyURL: proxyURL, client := req.C().
Timeout: 60 * time.Second, SetTimeout(60 * time.Second).
Impersonate: true, ImpersonateChrome().
}) SetCookieJar(nil) // 禁用 CookieJar
if strings.TrimSpace(proxyURL) != "" {
client.SetProxyURL(strings.TrimSpace(proxyURL))
}
return client
} }
func prefix(s string, n int) string { func prefix(s string, n int) string {
......
...@@ -76,7 +76,7 @@ type antigravityUsageCache struct { ...@@ -76,7 +76,7 @@ type antigravityUsageCache struct {
} }
const ( const (
apiCacheTTL = 10 * time.Minute apiCacheTTL = 3 * time.Minute
windowStatsCacheTTL = 1 * time.Minute windowStatsCacheTTL = 1 * time.Minute
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment