In my application I need to check the user authentication by two way first across username and password(both are database field),
cake php already give this by
$this->Auth->fields = array(
'username' => 'username',
'password' => 'password'
);
NOw MY need is if in first case user can not authenticate then check the user data across username and forgot_password(both are database field)
for that how can I use Auth component fields? I have tried :
else
{
$this->Auth->fields = array(
'username' => 'username',
'password' => 'forgot_password'
);
$this->Auth->login();
}
But this didn’t work..is there any other way?
I need both type of cross check condition as if else.
You should have to use
$this->Auth->constructAuthenticate();.