fix(oauth): 修复claude cookie添加账号时会话混淆的问题
This commit is contained in:
@@ -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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
apiCacheTTL = 10 * time.Minute
|
apiCacheTTL = 3 * time.Minute
|
||||||
windowStatsCacheTTL = 1 * time.Minute
|
windowStatsCacheTTL = 1 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user