-
-
Notifications
You must be signed in to change notification settings - Fork 177
Payload callback #102
Comments
Looking at the default payload creating method, it looks like it expects 'identity' instead of 'id' for the key. That might be the problem. Alternatively, perhaps checkout flask-jwt-extended. It's designed to make a few things llke this easier to do: http://flask-jwt-extended.readthedocs.io/en/latest/add_custom_data_claims.html (I am the author of that extension). Hope this helps! |
Hey thanks for answer! But I never see on the console the string Other things are working correctly, but I want to overwrite the payload.
|
I think you need to change it from jwt_payload_callback to On Oct 15, 2016 11:20 AM, "Nicolás Lara" [email protected] wrote:
|
Sorry, yes I'm using |
I dont, sorry. It's been a while since I used this library, and with all the open issues and pull requests it looks like it isn't being maintained at the moment either, which is why I made the flask_jwt_extended library. If you end up trying the flask_jwt_extended library and had issues there I would be able to help further. Best of luck getting this working, the source code for this library isn't very big, so perhaps looking though it you could find your answer. |
Thanks anyway for the predisposition to answer. I already see the code, but for the moment I didn't see a decorator for jwt_payload_hanlder, I will continue debugging if couldn't I will try to use your extension! |
@vimalloc I will remove flask-jwt use your extension! |
I hope it helps you out :) It's still a relatively new extension, so if you run into any oddities, issues, or missing features, please let me know. |
I just found an issue, I will write you on flask_jwt_extended github. |
Hey, I'm trying to overwrite the default payload_callback but I can't, what I'm doing wrong?
I would expect to see in payload next result:
{'iat': iat, 'exp': exp, 'nbf': nbf, 'id': u.id, 'role': u.role}
The text was updated successfully, but these errors were encountered: