jpulgarin/django-tokenapi

200 response code when invalid request is made

Closed this issue · 3 comments

If I make a request without a username or password, the returned status code is 200, while it should be 400. As a result, an incorrect request is treated as a correct one in the frontend.

This was already fixed by #33, what version are you using?

I am using the latest version on pypi. I will check again when I have the code in front of me, but I recall it being 1.0. I am making the request to retrieve a token, but without the required parameters.

Just fixed this @nicbou. The idea was that the fact that the JSON returned contained an 'error' key would be enough, but I agree that changing the status code is also the correct thing to do.