feat(auth): Add stable label to Gemini Web tokens for logging

This commit is contained in:
hkfires
2025-09-25 10:32:06 +08:00
parent 7f2e2fee56
commit 20f3e62529
5 changed files with 31 additions and 11 deletions

View File

@@ -49,6 +49,10 @@ func DoGeminiWebAuth(cfg *config.Config) {
hasher.Write([]byte(secure1psid))
hash := hex.EncodeToString(hasher.Sum(nil))
fileName := fmt.Sprintf("gemini-web-%s.json", hash[:16])
// Set a stable label for logging, e.g. gemini-web-<hash>
if tokenStorage != nil {
tokenStorage.Label = strings.TrimSuffix(fileName, ".json")
}
record := &sdkAuth.TokenRecord{
Provider: "gemini-web",
FileName: fileName,