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
basically we want some middleware that can load a user from a JWT and ensure that they have the right role (either admin or super or both etc). The above would work fine, but we want to send a 401 back in the middleware if the user doesn't have the right roles or if the JWT cannot be decrypted.
Is there a way to define middleware for each route, where that middleware can respond, so we don't have to handle that logic at every endpoint?
The text was updated successfully, but these errors were encountered:
We have this right now which works:
we want to do something like this:
basically we want some middleware that can load a user from a JWT and ensure that they have the right role (either admin or super or both etc). The above would work fine, but we want to send a 401 back in the middleware if the user doesn't have the right roles or if the JWT cannot be decrypted.
Is there a way to define middleware for each route, where that middleware can respond, so we don't have to handle that logic at every endpoint?
The text was updated successfully, but these errors were encountered: