title: Processing Login with Sentry 2
body: <p>I'm having trouble understanding Sentry 2 implementation for login. I mean in Sentry it was pretty strait forward. Provide username/email and password from Input to <code>Sentry::login()</code> method however they changed it now and it's really confusing.  </p>
  
  <p>First of all they removed Username column which makes no sense.<br>
  Second the login method now takes a User object that you need to retrieve using user's id which again makes no sense as you don't know the users id unless you make another query so they really complicated everything.  </p>
  
  <p>My code:  </p>
  
  <pre><code>public function login()
  {
      // Deny access to already logged-in user
      if(!Sentry::check())
      {
          $rules = array(
              'username' =&gt; 'required|unique:users',
              'password' =&gt; 'required' );
  
          $validator = Validator::make(Input::all(), $rules);
  
          if($validator-&gt;fails())
          {
              Session::flash('error', $validator-&gt;errors());
              return Redirect::to('/');
          }
  
          $fetch = User::where('username', '=', trim(Input::get('username')));
          $user = Sentry::getUserProvider()-&gt;findById($fetch-&gt;id);
  
          if(!Sentry::login($user, false))
          {
              Session::flash('error', 'Wrong Username or Password !');
          }
  
          return Redirect::to('/');
  
      }
  
      return Redirect::to('/');
  }
  </code></pre>
  
  <p>I tried using this approach but it throws an exception: that id is unknown despite id being part of the table and User model being nothing but a class declaration with a $table = 'users'; attribute.  </p>
  
  <p>What am I doing wrong here or not understanding.</p>