Jwt token expiration time extended from 2 to 24h
This commit is contained in:
1 parent
d4452bb3b1
commit
e065799edc
1 file changed
+1
-1
@@ -14,7 +14,7 @@ func generateToken(userID int, username string) (string, error) {
|
|||||||
claims := jwt.MapClaims{
|
claims := jwt.MapClaims{
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
"username": username,
|
"username": username,
|
||||||
"exp": time.Now().Add(2 * time.Hour).Unix(),
|
"exp": time.Now().Add(24 * time.Hour).Unix(),
|
||||||
}
|
}
|
||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
||||||
return token.SignedString(jwtSecret)
|
return token.SignedString(jwtSecret)
|
||||||
|
|||||||
Reference in new issue
Block a user