fix: still verify kid on single pub key fetched

This commit is contained in:
phuongnd96 2024-03-30 10:09:38 +07:00
parent 141396a214
commit 4bf4be3a0f
No known key found for this signature in database
GPG key ID: 7B4D09CD0726B8F2

View file

@ -114,7 +114,8 @@ class JWTHandler:
public_key: Optional[dict] = None
if len(keys) == 1:
public_key = keys[0]
if kid is None or key["kid"] == kid:
public_key = keys[0]
elif len(keys) > 1:
for key in keys:
if kid is not None and key["kid"] == kid: