UnauthorizedException handled internally
See original GitHub issueFollowing the NestJS JWT auth tutorial from the documentation I noticed that the UnauthorizedException is handled “internally”. Instead of printing
You’ll get {"statusCode":500,"message":"Internal server error"}
along with this log message [Nest] #14156 14:59:46 - error: [root] { statusCode: 401, error: 'Unauthorized' }
It should print that error as JSON response along with the right http response code right?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
UnauthorizedException is deliver as Internal Server Error
This filter is exported from auth-library, so UnauthorizedException indicates on the same object as AuthGuard. import { ArgumentsHost, Catch, ...
Read more >How to Handle Unathorized Exception
SharePoint “handles” Access denied exceptions by catching the exception internally and then redirecting the user to a landing page where ...
Read more >15.7. Exception Handling - Red Hat Customer Portal
Unauthorized. Security exception thrown if you are using RESTEasy's annotation-based role-based security. InternalServerErrorException, 500, Internal Server ...
Read more >How to handle unauthorized exception when adding a filter to ...
This article explains the topic, How to handle unauthorized exception when adding a filter to WinForms GridGroupingControl?
Read more >An opinionated way to consistent Error Handling in ASP.NET ...
It is common to see that popular HTTP error status codes such as 400 Bad Request , 401 Unauthorized , 404 Not found...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, make sure to get rid of internal
@nestjs/common
package installed by@nestjs/passport
(full path:node_modules/@nestjs/passport/node_modules/@nestjs/common
)Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.