feat(jwt): handle nil keyset
This commit is contained in:
parent
1996f4dc56
commit
d8ce2901d2
|
@ -61,6 +61,10 @@ func FindToken(r *http.Request, getKeySet GetKeySetFunc) (jwt.Token, error) {
|
||||||
return nil, errors.WithStack(err)
|
return nil, errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if keySet == nil {
|
||||||
|
return nil, errors.New("no keyset")
|
||||||
|
}
|
||||||
|
|
||||||
token, err := jwt.Parse([]byte(rawToken),
|
token, err := jwt.Parse([]byte(rawToken),
|
||||||
jwt.WithKeySet(keySet, jws.WithRequireKid(false)),
|
jwt.WithKeySet(keySet, jws.WithRequireKid(false)),
|
||||||
jwt.WithValidate(true),
|
jwt.WithValidate(true),
|
||||||
|
|
Loading…
Reference in New Issue