Closed benmoveai closed 3 months ago
cognitojwt/jwt_sync.py#get_public_key could raise a KeyError if the provided access token is malformed.
Such an error would look something like:
File "/opt/python/cognitojwt/jwt_sync.py", line 31, in get_public_key kid = headers['kid'] KeyError: 'kid'
Therefore, catch this KeyError and return a 401 unauthorised to the user.
cognitojwt/jwt_sync.py#get_public_key could raise a KeyError if the provided access token is malformed.
Such an error would look something like:
Therefore, catch this KeyError and return a 401 unauthorised to the user.