Middleware must not return any value or directly return a response for event. If you return a response, it will act as a normal event handler!
Middleware must not return any value or directly return a response for event. If you return a response, it will act as a normal event handler!
However, I need to redirect to a specific page if a user does not match some conditions. And this check needs to be performed on all possible server routes. What are the possible risks/side effects of using a
sendRedirect
sendRedirect
in a middleware in that case? Or what would be the best to implement this?