You need to remove your Auth controller routes outside of the group. You're applying the auth middleware on the login/registration routes. Those routes should be specifically for people who aren't authenticated. How can guests access the login route if you require them to be authenticated?
Oct 27, 2015
3
Level 1
The page isn't redirecting properly
This is My Route For Backend
Route::group(['prefix' => 'admin', 'namespace' => 'Backend', 'middleware' => 'auth' ], function()
{
// GET
# Admin Dashboard
Route::resource('/', 'WelcomeController');
Route::resource('/dashboard', 'WelcomeController');
# Auth Dashboard
Route::controllers([
'auth' => 'Auth\AuthController',
])
});
My problem is when i use Auth Middlewhere its shows me Error The page isn't redirecting properly
In Authenticate.php i edit this
public function handle($request, Closure $next)
{
if ($this->auth->guest()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
} else {
return redirect()->guest('admin/auth/login');
}
}
return $next($request);
}
If i just remove middlewhere from route then my page works fine. How can i fix it
Please or to participate in this conversation.