Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Conversation

@dokime7
Copy link

@dokime7 dokime7 commented Apr 11, 2016

When the user object returned by the authentication_handler is a dict, this exception is raised:
File "/usr/local/lib/python2.7/dist-packages/flask_jwt/init.py", line 53, in _default_jwt_payload_handler
identity = getattr(identity, 'id') or identity['id']
AttributeError: 'dict' object has no attribute 'id'
So getattr must not raise an exception but return None in order to evaluate the second par of the if: identity['id']

When the user object returned by the authentication_handler is a dict, this exception is raised:
  File "/usr/local/lib/python2.7/dist-packages/flask_jwt/__init__.py", line 53, in _default_jwt_payload_handler
    identity = getattr(identity, 'id') or identity['id']
AttributeError: 'dict' object has no attribute 'id'
So getattr must not raise an exception but return None in order to evaluate the second par of the if: identity['id']
@dokime7
Copy link
Author

dokime7 commented Apr 11, 2016

Sorry, this is a dupplicate of #78

@dokime7 dokime7 closed this Apr 11, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.652% when pulling 17b81b4 on dokime7:patch-1 into c270841 on mattupstate:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants