0
登錄失敗後,我應該如何將用戶重定向到登錄頁面? 我試圖在AuthController
:Laravel 5.2:將用戶重定向到登錄頁面失敗後
protected $redirectTo ='/login';
protected $loginView = 'auth.login_register_form';
protected $loginPath = '/login';
,但用戶不重定向到/login
頁,他被重定向回他是在
詛咒之前存在AuthenticateUser.php
充當登錄的方法在網頁失敗的方法:
protected function sendFailedLoginResponse(Request $request)
{
return redirect()->back()
->withInput($request->only($this->loginUsername(), 'remember'))
->withErrors([
$this->loginUsername() => $this->getFailedLoginMessage(),
]);
}
,但我不能編輯此方法。這是laravel核心文件之一。
你在說「AuthController」嗎? – alex
是的,如果你的驗證失敗添加重定向到你想要的頁面 – KuKeC
謝謝,所以你的意思是沒有財產去做成功登錄或註銷的工作。我應該自己寫這個方法 – alex