Example #1
0
 public function post_login()
 {
     $login_data = array('username' => \Input::get('req_username'), 'password' => \Input::get('req_password'));
     // TODO: Add remember me setting once supported by Illuminate
     if (\Auth::attempt($login_data)) {
         // Make sure last_visit data is properly updated
         \Session::sweep();
         // TODO: This is properly validated in URL::to, right?
         $redirect_url = \Input::get('redirect_url', \URL::action('fluxbb::home@index'));
         return \Redirect::to($redirect_url)->with('message', 'You were successfully logged in.');
     } else {
         $errors = new \Illuminate\Validation\MessageBag();
         $errors->add('login', 'Invalid username / password combination.');
         return \Redirect::action('fluxbb::auth@login')->withInput(\Input::all())->with('errors', $errors);
     }
 }