I have problem with Auth in Cakephp 2.4 , can not login and I can not find error in my code
My AppController
user Model
my login method
public function cpadmin_login()
{
$this->pageTitle = __('Login page', true);
if ($this->request->is('post')) {
if ($this->Auth->login()) {
return $this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');
}
}
}
while try do login by username/password not thing happen and sql log no password check
sql log
SELECT `User`.`id`, `User`.`name`, `User`.`username`, `User`.`password`, `User`.`email`, `User`.`role_id`, `User`.`active`, `User`.`created`, `Role`.`id`, `Role`.`name`, `Role`.`roles` FROM `cairotweet`.`users` AS `User` LEFT JOIN `cairotweet`.`roles` AS `Role` ON (`User`.`role_id` = `Role`.`id`) WHERE `User`.`username` = 'admin' AND `User`.`active` = 1 LIMIT 1