Example #1
0
 public function postLogin()
 {
     $email = Input::get('email');
     $password = Input::get('password');
     if (Auth::attempt(array('email' => $email, 'password' => $password))) {
         Success::flash('successMessage', 'Welcome to the blog, user!');
         return Redirect::intended('/posts');
     } else {
         // login failed, go back to the login screen
         Session::flash('error message', 'Login failed.  Your username and/or password don\'t match.');
         return Redirect::back()->withInput();
     }
 }