mirror of
https://github.com/1f349/mjwt.git
synced 2024-11-09 22:22:48 +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"]
|
||||
if exs {
|
||||
kID, ok := kIDI.(string)
|
||||
if ok {
|
||||
key := d.kStore.GetKeyPublic(kID)
|
||||
if key == nil {
|
||||
return nil, ErrNoPublicKeyFound
|
||||
} else {
|
||||
return key, nil
|
||||
}
|
||||
} else {
|
||||
if !ok {
|
||||
return nil, ErrKIDInvalid
|
||||
}
|
||||
key := d.kStore.GetKeyPublic(kID)
|
||||
if key == nil {
|
||||
return nil, ErrNoPublicKeyFound
|
||||
} else {
|
||||
return key, nil
|
||||
}
|
||||
}
|
||||
if d.pub == nil {
|
||||
return nil, ErrNoPublicKeyFound
|
||||
|
Loading…
Reference in New Issue
Block a user