pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 178 forks source link

Fails on authenticating dict based user #92

Open menudoproblema opened 8 years ago

menudoproblema commented 8 years ago

To reproduce this bug you can use this authenticate function:

def authenticate(username, password):
    return {'id': '1', 'username': 'test', 'password': 'test'}

Trace:

File ".../lib/python3.5/site-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'
coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 95.652% when pulling 030e870788f32db4cd7da0bb620b83cf39e547ed on menudoproblema:master into c27084114e258863b82753fc574a362cd6c62fcd on mattupstate:master.

stephane commented 8 years ago

Already fixed by #63 and so many others ;)

Updated after @dequis comment

dequis commented 7 years ago

@stephane I think you mean #63

stephane commented 7 years ago

Yes you're right