/**
  * Handle a login request to the application.
  *
  * @param  LoginRequest $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect('/');
     }
     return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }
 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     // If authentication is successful lets send them to the homepage.
     //
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect('/');
     }
     // Flash an error message to the user.
     //
     Flash::error('The credentials you entered did not match our records. Try again?');
     // Redirect the user back to the page.
     //
     return redirect('/login')->withInput();
 }
Ejemplo n.º 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param \Codeboard\Http\Requests\Auth\LoginRequest $request
  * @param \Illuminate\Contracts\Auth\Authenticator $auth
  * @return Response
  */
 public function store(LoginRequest $request, Authenticator $auth)
 {
     if ($auth->attempt($request->only('email', 'password'), true)) {
         return redirect()->intended('/');
     } else {
         return redirect()->back()->withInput()->withErrors(['Credentials are incorrect']);
     }
 }