CakePHP - Auth

Hi

I am using the following code to authenticate a user:


function beforeFilter() {
                $this->Auth->fields = array('username' => 'email', 'password' => 'password');
 
        }


Its working fine! But, I want cakephp to validate the auth with username = ‘email’ OR username = ‘username’

I tried the following but its not working:


function beforeFilter() {
                $this->Auth->fields = array('username' => array('email','username'), 'password' => 'password');
 
        }


Can anyone help me with this pls?

Many Thanks