mirror of
https://github.com/1f349/mjwt.git
synced 2024-12-22 07:24:05 +00:00
Fix pendantic negation issue.
This commit is contained in:
parent
9a1029861c
commit
3201964fec
@ -78,16 +78,15 @@ func (d *defaultMJwtVerifier) VerifyJwt(token string, claims baseTypeClaim) (*jw
|
|||||||
kIDI, exs := token.Header["kid"]
|
kIDI, exs := token.Header["kid"]
|
||||||
if exs {
|
if exs {
|
||||||
kID, ok := kIDI.(string)
|
kID, ok := kIDI.(string)
|
||||||
if ok {
|
if !ok {
|
||||||
|
return nil, ErrKIDInvalid
|
||||||
|
}
|
||||||
key := d.kStore.GetKeyPublic(kID)
|
key := d.kStore.GetKeyPublic(kID)
|
||||||
if key == nil {
|
if key == nil {
|
||||||
return nil, ErrNoPublicKeyFound
|
return nil, ErrNoPublicKeyFound
|
||||||
} else {
|
} else {
|
||||||
return key, nil
|
return key, nil
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return nil, ErrKIDInvalid
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if d.pub == nil {
|
if d.pub == nil {
|
||||||
return nil, ErrNoPublicKeyFound
|
return nil, ErrNoPublicKeyFound
|
||||||
|
Loading…
Reference in New Issue
Block a user