title: Why won't the Auth Component username & password login automagic work as expected in CakePHP?
body: <p>I am trying to build the login registration page for my website, I am facing problems with he Auth Component,</p>
  
  <pre><code>function beforeFilter() {
      $this-&gt;Auth-&gt;loginAction = array('controller'=&gt;'users','action'=&gt;'login');
      $this-&gt;Auth-&gt;loginRedirect = array('controller'=&gt;'users','action'=&gt;'landing');
      $this-&gt;Auth-&gt;logoutRedirect = array('controller'=&gt;'users','action'=&gt;'home');
  
      // These pages do not require authenication&lt;br/&gt;
      $this-&gt;Auth-&gt;allow('home','register','activate','forgot','reset','_sendEmail','reset');
  }
  </code></pre>
  
  <p>I am encrypting and storing the passwords in the database using <code>$this-&gt;Auth-&gt;password</code> method, now even when I log in succesfully I dont get redirected to the landing page under users controller, I tried printing out <code>$this-&gt;Auth</code> and it says</p>
  
  <pre><code>[loginError] =&gt; Login failed. Invalid username or password.
  [authError] =&gt; You are not authorized to access that location.
  </code></pre>
  
  <p>Also in my database the fields against which I am using authentication are email and password, I read somewhere that the AuthComponent requires the fields to be username and password for the automagic to work</p>
  
  <p>I cant figure out what I am doing wrong, also after logging in, if I try to point my browser to <a href="http://cake.localhost/users/register" rel="nofollow noreferrer">http://cake.localhost/users/register</a> it should automatically redirect me to the landing page but it doesnt for some reason.</p>
  
  <p>Any clues as to where I am going wrong?</p>
  
  <p>Shiv </p>