New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print AuthJWTException message #18
Comments
you can try to use e.message and e.status_code if you only print e it gives nothing |
When I supply wrong access token , it gives status code 422. It needs to give 401. |
The reason I use status code 422 because sending invalid fields will result in a 422 Unprocessable Entity response. Can you give reasonable use 401 instead of 422 when the token is invalid? |
Yeah I got it. |
While testing protected endpoint, I put wrong access token (deleting some values in actual access token) in Postman. I tired to print AuthJwt exception but it gives nothing. When I donot supply access token, no any exception message is printed.
For example: access token is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
But I put access token in Postman as eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJz to test
It gives nothing while printing print(e).
Code in main.py
How toc check individual exception?
The text was updated successfully, but these errors were encountered: