fix: token expiration sets to 12 hours

main
Nilo Roberto C Paim 2023-11-06 10:55:17 -03:00
parent d4d05a498a
commit ee65139bfc
1 changed files with 2 additions and 2 deletions

View File

@ -48,8 +48,8 @@ func Login(c *fiber.Ctx) error {
}
claims := &jwt.RegisteredClaims{
ExpiresAt: &jwt.NumericDate{Time: time.Now().Add(30 * time.Second)}, // Token expiration time
Issuer: strconv.Itoa(int(user.ID)), // Subject of the token
ExpiresAt: &jwt.NumericDate{Time: time.Now().Add(12 * time.Hour)}, // Token expiration time
Issuer: strconv.Itoa(int(user.ID)), // User that creates the token
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)