Browse Source

token claims expire fixed

0x4a52466c696e74 1 month ago
parent
commit
46f408fc52
1 changed files with 2 additions and 1 deletions
  1. 2 1
      server.go

+ 2 - 1
server.go

@@ -115,7 +115,8 @@ func (s *Server) TokenGenerate(m json.Map, expire int64) (string, error) {
 		claims[key] = val
 	}
 	if expire > 0 {
-		claims["exp"] = time.Now().Add(time.Minute * 30).Unix()
+		//claims["exp"] = time.Now().UTC().Add(time.Minute * 30).Unix()
+		claims["exp"] = expire
 	}
 
 	tokenString, err := token.SignedString(s.Secret())