【发布时间】:2015-07-14 10:59:28
【问题描述】:
我正在尝试使用 Laravel 5 用户身份验证。在这方面,我的 URL 是http://localhost/lara_project/public/auth/login 登录前。我想在成功登录后将用户重定向到http://localhost/lara_project/public/home。但它被重定向到http://localhost/lara_project/public/。我尝试了如下路线
Route::get('home',['middleware' => 'auth', 'uses' => 'WelcomeController@index']);
Route::get('/', 'HomeController@index');
Route::controllers(['auth' => 'Auth\AuthController','password' => 'Auth\PasswordController']);
位于 routes.php
中我的问题是成功登录用户重定向到http://localhost/lara_project/public/,如果我想在成功登录后浏览http://localhost/lara_project/public/home,则会显示错误
This webpage has a redirect loop
ERR_TOO_MANY_REDIRECTS
我尝试编辑 RedirectIfAuthenticated.php、compiled.php 和 AuthenticatesAndRegistersUsers 文件。但未能得到满意的结果。
有人可以在这方面帮助我吗?
【问题讨论】:
标签: php authentication laravel-5