How should i redirect user to login page after a failed login?
i tried in AuthController
:
protected $redirectTo ='/login';
protected $loginView = 'auth.login_register_form';
protected $loginPath = '/login';
but user does not redirected to /login
page , he get redirected back to the page he was in before
of curse there is a method in AuthenticateUser.php
that serve as login fails method:
protected function sendFailedLoginResponse(Request $request)
{
return redirect()->back()
->withInput($request->only($this->loginUsername(), 'remember'))
->withErrors([
$this->loginUsername() => $this->getFailedLoginMessage(),
]);
}
but i'm not allowed to edit this method . this is one of laravel core files.