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']
Coverage remained the same at 95.652% when pulling 17b81b4dfa6dcdfef05aa68deacb7aeaaa33d3fb on dokime7:patch-1 into c27084114e258863b82753fc574a362cd6c62fcd on mattupstate:master.
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']