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
{{ message }}
Repository navigation
How to include auth middleware that handles roles for logged-in users #426
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?
Activity
ORESoftware commentedon Mar 11, 2020
So it looks like we can use something like this:
is that about right?