The error "Invalid username or password, try again" appears after you clicked on the username?
There are a few things you should check out:
• Is the output of $this->Auth->login() identical to the information in your database? Place debug($this->Auth->login()) to see the result in your login method after submitting the form.
• Are passwords in the database correctly hashed?
• Try making AuthComponent available to all of your controllers, not just UsersController .
• Not sure if this matters, but call parent::beforeFilter(); first of all in your beforeFilter control beforeFilter .
EDIT:
Sees what you are trying to verify based on email and password. By default, AuthComponent expects a username and password. You must explicitly indicate that you want the email address and password to be verified with $this->Auth->login() . This comes from the 2.0 documentation:
public $components = array( 'Auth'=> array( 'authenticate' => array( 'Form' => array( 'fields' => array('username' => 'email') ) ) ) );
I suppose to expect that you do not see SQL output.
mensch
source share