You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add exception handling on endpoints that use JWT for authentication
Context
Class JWTBearer raises BadJWTTokenProvidedError exception when JWT provided is invalid. We need to catch that error in the endpoints that use token authentication.
How to do it
Add exception handling at controller level for all endpoints that use token: Annotated[TokenData, Depends(JWTBearer())], for authentication. Try to put this exception handling sorted based on exception code. Example: 401 then 402, 403 ....
Description
Add exception handling on endpoints that use JWT for authentication
Context
Class
JWTBearer
raisesBadJWTTokenProvidedError
exception when JWT provided is invalid. We need to catch that error in the endpoints that use token authentication.How to do it
Add exception handling at controller level for all endpoints that use
token: Annotated[TokenData, Depends(JWTBearer())],
for authentication. Try to put this exception handling sorted based on exception code. Example: 401 then 402, 403 ....Testing
How to test the feature
🖐️ Learn how to CONTRIBUTE, all help is welcomed :)
📚 Check out the project documentation for more info
⭐ Help this project grow by giving it a star if you like it!
😵 Trello links are used for traceability, do not ask to join the board before leaving a comment in the related issue
The text was updated successfully, but these errors were encountered: