redirect to default login url only after access unothorized page
Opened this issue · 4 comments
srengkhorn commented
redirect to default login url only after access unothorized page
lethienhung commented
I got the same problem, have anyone know how to fix this yet?
I have 2 actors: admin and user
when I try to access the user homepage without authentication, the server redirect me to the login url of admin.
obscurecloud commented
+1
I'm trying to work this out too.
obscurecloud commented
So not the best solution, but this post #50 led me to this solution
Adding this to app/Exceptions/Handler.php render()
if ($exception instanceof \Illuminate\Auth\AuthenticationException) {
if ($request->is('admin')) {
return redirect()->guest('/admin/login');
}
}
abdulmananse commented
I got the same problem, but i'm resolved this issue.
Remove auth:admin middleware from mapAdminRoutes function in app\Providers\RouteServiceProvider.php