title: Using email instead of username in CakePHP's Auth Component
body: <p>CakePHP's Auth component requires the username field to be present in order to convert the password field into a hash upon save. Apparently, even if I put the following in the <code>beforeFilter()</code>:</p>
  
  <pre><code>$this-&gt;Auth-&gt;fields = array('username' =&gt; 'email', 'password' =&gt; 'password');
  </code></pre>
  
  <p>it doesn't encrypt the password before inserting it into the database.</p>
  
  <p>So my question is, assuming this is supposed to happen, what is the best way to encrypt the password? Or, have I made a simple error somewhere?</p>
  
  <p>Thanks in advance for any assistance!</p>
  
  <p>Here's the before filter in the users_controller.php:</p>
  
  <pre><code>function beforeFilter() {
      $this-&gt;Auth-&gt;fields = array('username' =&gt; 'email', 'password' =&gt; 'password');
  }
  </code></pre>
  
  <p>And the app_controller.php:</p>
  
  <pre><code>var $components = array('Auth');
  </code></pre>