title: Can't get Auth login to work with CakePHP 2.0
body: <p>I'm trying to get a simple login form to work using CakePHP 2.0... just Auth, no ACLs for now.</p>
  
  <p>I'm able to see the form and enter the email and password as they are in the database, but I just get returned to the form and the flash error message is displayed. Here is my code:</p>
  
  <p><strong>AppController:</strong></p>
  
  <pre><code> class AppController extends Controller
   {
       function beforeFilter()
       {
           $this-&gt;Auth-&gt;userModel = 'Users';
           $this-&gt;Auth-&gt;fields = array('username' =&gt; 'email', 'password' =&gt; 'password'); //have to put both, even if we're just changing one
           $this-&gt;Auth-&gt;loginAction = array('controller' =&gt; 'users', 'action' =&gt; 'login');
           $this-&gt;Auth-&gt;loginRedirect = array('controller' =&gt; 'hotels', 'action' =&gt; 'dashboard');
           $this-&gt;Auth-&gt;logoutRedirect = array('controller' =&gt; 'users', 'action' =&gt; 'login');
       }
   }
  </code></pre>
  
  <p><strong>login.ctp:</strong></p>
  
  <pre><code>&lt;?php
           echo $this-&gt;Form-&gt;create('User', array('action' =&gt; 'login'));
           echo $this-&gt;Form-&gt;input('email');
           echo $this-&gt;Form-&gt;input('password');
           echo $this-&gt;Form-&gt;end('Login');
       ?&gt;
  </code></pre>
  
  <p><strong>UsersController:</strong>
       
  
  <pre><code> class UsersController extends AppController
   {
       var $name = 'Users';
       var $helpers = array('Html','Form');
       var $components = array('Auth','Session');
  
       function beforeFilter()
       {
           $this-&gt;Auth-&gt;allow("logout");
           parent::beforeFilter();
       }
  
       function index() { } //Redirects to login()
  
       function login()
       {
           if ($this-&gt;Auth-&gt;login())
           {
               $this-&gt;redirect($this-&gt;Auth-&gt;redirect());
           } else
           {
               $this-&gt;Session-&gt;setFlash(__('Invalid username or password, try again'));
           }
       }
  
       function logout()
       {
           $this-&gt;redirect($this-&gt;Auth-&gt;logout());
       }
   }
   ?&gt;
  </code></pre>
  
  <p>I appreciate any help with this. Thanks!</p>