🐛 Use relative path when cache token

This commit is contained in:
OpenWaygate committed 2025-09-26 23:02:45 +08:00
1 parent 20d6f26a1f
commit 24f5dd9118
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -115,11 +115,11 @@ func WithCacheToken(token string, fsys fs.FS) Option {
if err != nil {
slog.Warn(readTokenFailed, "path", absToken, "error", err)
}
s.tokenFile = absToken
s.tokenFile = relToken
s.CacheToken = string(tokenBytes)
return
} else if os.IsNotExist(err) && strings.HasSuffix(token, ".json") {
s.tokenFile = absToken
s.tokenFile = relToken
return
}
+1 -1
View File
@@ -71,7 +71,7 @@ func TestNewY2BService(t *testing.T) {
Credential: credential,
CacheToken: cacheToken,
credFile: "/client_secrets.json",
tokenFile: "/youtube.token.json",
tokenFile: "youtube.token.json",
ctx: context.Background(),
},
},
+1 -1
View File
@@ -31,7 +31,7 @@ func init() {
panic(err)
}
logLevel := slog.LevelInfo
logLevel := slog.LevelWarn
if lvl, ok := os.LookupEnv("YUTU_LOG_LEVEL"); ok {
switch lvl {
case "DEBUG", "debug":