vimalloc / flask-jwt-extended

An open source Flask extension that provides JWT support (with batteries included)!
http://flask-jwt-extended.readthedocs.io/en/stable/
MIT License
1.56k stars 239 forks source link

No 401 on failure #516

Closed Makistos closed 1 year ago

Makistos commented 1 year ago

This is the same issue as the pinned one but as it's locked and it was requested a new ticket to be made instead here it is. I don't use the components mentioned (such as the REST helper) so I didn't spot any help from that issue.

I don't have a minimal example but my backend should be easy enough to set up & try. Here are the steps:

  1. Clone https://github.com/Makistos/suomisf.git.
  2. Create virtual environment & install requirements.
  3. Start with flask run.
  4. Send a request to an endpoint requiring a token: curl -X PUT http://127.0.0.1:5000/editions.

This will return 500.

I have a custom hook (jwt_admin_required) located in app/api_jwt.py but app never gets to it when this error happens. Login function is at the top of impl_users.py.

Makistos commented 1 year ago

Ach. This is what happens when you have more than one issue at hand at the same time. I got a similar error and at some point it changed to a different internal error which I was able to figure out but I didn't notice this before I pasted the error.

Sorry for the inconvenience.