I have done all the settings for login in cakephp 3.2,but while login it is returning false.
login function in usercontroller
public function login() {
$this->viewBuilder()->layout('');
if ($this->request->is('post')) {
$user = $this->Auth->identify();
pj($user);//returning false
if ($user) {
$this->Auth->setUser($user);
return $this->redirect($this->Auth->redirectUrl());
}
$this->Flash->error(__('Invalid username or password, try again'));
}
}
This function $user = $this->Auth->identify();
is always returning false.
Why can't i login?
In data base password is stored as
$2y$10$4aD6Ye6YcmPGKgI/CmhJBO0E//9tV.KvhJIOFAhajyqt8vfxDVASC
I am getting the email and password from $this->request->data
.
Any suggestion will highly appreciate. thank you in advance.