This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 177
AttributeError: 'dict' object has no attribute 'id' #115
Comments
I have a user model looks like this
instead of id I have ID in the object so I get
Is there any work around to use custom id field in identity object ? |
I have just created a class instead of a |
I'm also getting this error. I'm using namedtuple as a workaround |
I would also like to use another property name, since |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When passing
{'id': 'someId'}
into the_default_jwt_payload_handler
it raises an exception.The problem is in this expression:
identity = getattr(identity, 'id') or identity['id']
https://github.com/mattupstate/flask-jwt/blob/master/flask_jwt/__init__.py#L53
It must be:
identity = getattr(identity, 'id', None) or identity['id']
The text was updated successfully, but these errors were encountered: