Middlewares
Not sure if I've overlooked the docs or not.
So I know there is the authMiddlewares in the provider. However, I have a middleware that checks for a global 2fa we have. I want all routes to be hidden if the middleware fails, but I want to still allow access to the dashboard only.
Is there a way to do this that Im just not seeing?
8 Replies
Do you use the default dashboard? One way would be to create/extend your own and ignore the 2fa middleware in the ignored ones?
Is that a property in the dashboard class
It's in the resources. Hmm didn't check the dashboard tbh
Is there an opposite, so that in the resources that I want in the middleware, I can add them there
Might be a solution for me
Ok I checked. It's in the
HasRoutes
trait, so it can be used in the Dashboard class too.
You can also do
if you want the oppositeSo that property goes in the resource directly?
As in the UserResource, I've put
But I still have access when I shouldnt
Yeap. So something like
yeah
I guess. I've never tried it myself, but that's the idea
Yeah, Ill have a play around, as it currently should block me from viewing the list of users, but is still letting me instead.
Cheers bud π