feat: add configurable JWT timeout setting (#1014)

This commit is contained in:
JSker9
2025-03-02 15:37:46 +08:00
committed by GitHub
parent 5c8cc75523
commit b23680f913
2 changed files with 8 additions and 2 deletions

View File

@@ -22,8 +22,8 @@ func initParams() *jwt.GinJWTMiddleware {
Key: []byte(singleton.Conf.JWTSecretKey),
CookieName: "nz-jwt",
SendCookie: true,
Timeout: time.Hour,
MaxRefresh: time.Hour,
Timeout: time.Hour * time.Duration(singleton.Conf.JWTTimeout),
MaxRefresh: time.Hour * time.Duration(singleton.Conf.JWTTimeout),
IdentityKey: model.CtxKeyAuthorizedUser,
PayloadFunc: payloadFunc(),