Laravel 5 authentication middleware always redirects to root or login

南楼画角 提交于 2019-12-06 13:26:57

If you are going to be using Auth you should have the 'web' group applied to those routes as well.

You can adjust your route group that is using the 'auth' middleware to:

Route::group(['middleware' => ['web', 'auth']], function () {
    // ...
});

UPDATE For Laravel 5.2.27. If you have installed a fresh copy of laravel/laravel >= 5.2.27 Your routes will be wrapped in a group that applies the 'web' middleware by default now. This is only for fresh installs as this change is to App\Providers\RouteServiceProvider which an upgrade to laravel/framework will not touch.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!