flask-jwt icon indicating copy to clipboard operation
flask-jwt copied to clipboard

Fails on authenticating dict based user

Open menudoproblema opened this issue 9 years ago • 4 comments

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'

menudoproblema avatar Jul 10 '16 10:07 menudoproblema

Coverage Status

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

coveralls avatar Jul 10 '16 10:07 coveralls

Already fixed by #63 and so many others ;)

Updated after @dequis comment

stephane avatar Aug 03 '16 22:08 stephane

@stephane I think you mean #63

dequis avatar Dec 13 '16 15:12 dequis

Yes you're right

stephane avatar Dec 14 '16 11:12 stephane