The default implementation of jwt_payload_handler fails if the identity object has no id attribute, even though it was clearly an intention to fall back to a dictionary lookup when such an attribute does not exist. The current implementation fails because getattr throws an AttributeError for missing attributes if no default value is provided. The patch fixes this by providing a default value of None for the attribute lookup, preventing the exception.
The default implementation of
jwt_payload_handler
fails if theidentity
object has noid
attribute, even though it was clearly an intention to fall back to a dictionary lookup when such an attribute does not exist. The current implementation fails becausegetattr
throws anAttributeError
for missing attributes if no default value is provided. The patch fixes this by providing a default value ofNone
for the attribute lookup, preventing the exception.