Hesto/multi-auth

redirect to default login url only after access unothorized page

Opened this issue · 4 comments

redirect to default login url only after access unothorized page

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.

+1
I'm trying to work this out too.

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');
            }
        }

I got the same problem, but i'm resolved this issue.
Remove auth:admin middleware from mapAdminRoutes function in app\Providers\RouteServiceProvider.php