upgraded to jwt/v5

This commit is contained in:
Gani Georgiev committed 2025-01-05 11:18:00 +02:00
1 parent 41f1ff2b5f
commit b150a3a98a
11 files changed
+43 -33

No files matched your search

+2 -3
View File
@@ -4,8 +4,7 @@ import (
"errors"
"time"
// @todo update to v5
"github.com/golang-jwt/jwt/v4"
"github.com/golang-jwt/jwt/v5"
)
// ParseUnverifiedJWT parses JWT and returns its claims
@@ -19,7 +18,7 @@ func ParseUnverifiedJWT(token string) (jwt.MapClaims, error) {
_, _, err := parser.ParseUnverified(token, claims)
if err == nil {
err = claims.Valid()
err = jwt.NewValidator(jwt.WithIssuedAt()).Validate(claims)
}
return claims, err