fastapi-jwt-auth
fastapi-jwt-auth copied to clipboard
allow strictBytes type for secret
we have a secret key that is in bytes (not utf-8 unfortunately).
PyJWT does this..
def force_bytes(value):
if isinstance(value, text_type):
return value.encode('utf-8')
elif isinstance(value, binary_type):
return value
else:
raise TypeError('Expected a string value')
eg it allows to use bytes for the key.
Modifying type confirms works fine.