Fix pendantic negation issue.

This commit is contained in:
Captain ALM 2024-06-09 21:23:28 +01:00
parent 9a1029861c
commit 3201964fec
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -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