nianhua99 / PandoraHelper

使用 PandoraHelper 轻松和你的小伙伴共享 ChatGPT Plus/Claude Pro 服务!
MIT License
753 stars 124 forks source link

更换at时提示token has invalid claims: token is expired #105

Closed islercn closed 3 weeks ago

islercn commented 3 weeks ago

plus会员,尝试更换一个新的token时提示token is expired,确定token在有效期,且在new.oaifree.com或通过chat2api中可以正常使用,应该是替换token的逻辑有问题

日志如下:

{"level":"error","ts":1724042271.629171,"caller":"service/share.go:231","msg":"RefreshShareToken error","err":"{\"detail\":\"token has invalid claims: token is expired\"}","stacktrace":"PandoraHelper/internal/service.(*shareService).GetShareTokenByAccessToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:231\nPandoraHelper/internal/service.(*shareService).RefreshShareToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:288\nPandoraHelper/internal/service.(*accountService).RefreshAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:84\nPandoraHelper/internal/service.(*accountService).Update\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:95\nPandoraHelper/internal/handler.(*AccountHandler).UpdateAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/handler/account.go:81\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.StrictAuth.func10\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/jwt.go:38\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.RequestLogMiddleware.func8\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:32\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.ResponseLogMiddleware.func7\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:40\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.CORSMiddleware.func6\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/cors.go:21\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.(*Middleware).Handle\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:64\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.NewMiddleware.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:35\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576\nnet/http.serverHandler.ServeHTTP\n\tD:/dev/env/env/src/net/http/server.go:3137\nnet/http.(*conn).serve\n\tD:/dev/env/env/src/net/http/server.go:2039"}

nianhua99 commented 3 weeks ago

非常好的日志,使我快速排查问题

nianhua99 commented 3 weeks ago

已修复