jwt.StandardClaims
}
-func SetJwtSecretKey(secret string) {
- JWT_SECRET = []byte(secret)
-}
-
func VerifyJwtToken(token string) (JwtClaims, error) {
if len(JWT_SECRET) == 0 {
return JwtClaims{}, fmt.Errorf("not initialized jwt secret")
false,
userId,
jwt.StandardClaims{
- ExpiresAt: time.Now().Add(time.Hour * 24).Unix(),
+ ExpiresAt: time.Now().Add(time.Hour * 24 * 7).Unix(),
},
}