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
15
verifier.go
15
verifier.go
@ -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 {
|
||||||
key := d.kStore.GetKeyPublic(kID)
|
|
||||||
if key == nil {
|
|
||||||
return nil, ErrNoPublicKeyFound
|
|
||||||
} else {
|
|
||||||
return key, nil
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return nil, ErrKIDInvalid
|
return nil, ErrKIDInvalid
|
||||||
}
|
}
|
||||||
|
key := d.kStore.GetKeyPublic(kID)
|
||||||
|
if key == nil {
|
||||||
|
return nil, ErrNoPublicKeyFound
|
||||||
|
} else {
|
||||||
|
return key, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if d.pub == nil {
|
if d.pub == nil {
|
||||||
return nil, ErrNoPublicKeyFound
|
return nil, ErrNoPublicKeyFound
|
||||||
|
Loading…
Reference in New Issue
Block a user