In my laravel project I have a Middleware to check user role.
Now in routes.php I have 2 groups, one of them is admin area group, I have applied middleware to only that group.
It works till now as expected, if logged in user has admin rights then he can access admin pages.
But I am not even able to access other routes, they all are giving me unauthorised error. Even if I haven't applied middleware to those routes.
Means that CheckRole middleware is running globally on every request.
Others routes that are not admin area, those are accessed via angularjs.
Maybe I don't know how Middlewares actually works, and I am missing something. Please share your knowledge.
Thanks.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire