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
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
I can't detect within the middleware if the route exists, my auth module based on path, so naturally all requests become 401 thought it's 404, it's very confusing for users.
Expected behavior
404 happens before middleware or there is a way to detect it during middleware and throw a 404 error manually.
Minimal reproduction of the problem with instructions
if (!permissions.granted)
next( new UnauthorizedException('error message goes here'))
changing it to throw also didn't help, so the only solution I have is to put error flag to request as a parameter and then throw it there, which is ugly.
I did implement the BaseExceptionFilter, but it also caught only the error I throw, not the 404 error.
What is the motivation / use case for changing the behavior?
I'd suggest tracking this issue #1030 which should enable generation of all routes defined in your app (then you could simply iterate through an array and in case of a missing endpoint, throw 404 error)
I'm submitting a...
Current behavior
I can't detect within the middleware if the route exists, my auth module based on path, so naturally all requests become 401 thought it's 404, it's very confusing for users.
Expected behavior
404 happens before middleware or there is a way to detect it during middleware and throw a 404 error manually.
Minimal reproduction of the problem with instructions
in the middleware I'm doing that:
changing it to throw also didn't help, so the only solution I have is to put error flag to request as a parameter and then throw it there, which is ugly.
I did implement the BaseExceptionFilter, but it also caught only the error I throw, not the 404 error.
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: