flask-jwt
flask-jwt copied to clipboard
_default_auth_request_handler() Doesn't check for NoneType request.get_json()
- Send POST request with no payload to /auth
- Flask will return 500 Internal server error, in the debug mode it shows AttributeError: 'NoneType' object has no attribute 'get'
Perhaps check out https://github.com/vimalloc/flask-jwt-extended. It provides more leeway in this regard, as you define your own endpoint for authing, and once your code has run, you can use functions like 'create_access_token' or 'create_refresh_token' to generate the JWTs, and return them in whatever way works for you. It also supports refresh tokens, revoking tokens, and fresh/unfresh tokens out of the box. (This is totally a shameless pug, as I'm the author of that extension).
It's still under development, but the code should be basically finalized today, and proper readthedocs should be here by the end of the week :)
Hey @vimalloc, I think I got a little lost in the forks of the current project. It seems like there are a lot of outstanding PRs. Thanks for mentioning flask-jwt-extended, seems interesting and I will give it a shot!
Glad to hear it! :) If you can think of any ways to improve upon it, I would love to hear them. Cheers.
did anyone solve this error?