i have a problem with the auth component of cakephp i follow this guide to create the legacypasswordhasher https://book.cakephp.org/3.0/en/controllers/components/authentication.html i load the class in the appcontroller like this:
$this->loadComponent('Auth', [
'authenticate' => [
'Form' => [
'passwordHasher' => [
'className' => 'Legacy',
]
]
]
]);
and i have created the legacypasswordhelper class in src/Auth like this:
namespace App\Auth;
use Cake\Auth\AbstractPasswordHasher;
class LegacyPasswordHasher extends AbstractPasswordHasher
{
public function hash($password)
{
return sha1($password);
}
public function check($password, $hashedPassword)
{
return sha1($password) === $hashedPassword;
}
}
?>
but if i login in my form the auth component dont run legacypassword functions. i use debugs in the hash and check function but it never shown. i hope anyone have a solution