DrupalPasswordHasher for CakePHP 3.x
composer require fawno/drupal-password-hasher
use Fawno\Auth\DrupalPasswordHasher;
$this->loadComponent('Auth', [
'authenticate' => [
'Form' => [
'passwordHasher' => DrupalPasswordHasher::class,
'fields' => [
'username' => 'username',
'password' => 'password',
]
]
],
]);
use Fawno\Auth\DrupalPasswordHasher;
class User extends Entity {
protected function _setPassword ($value) {
if (strlen($value)) {
$hasher = new DrupalPasswordHasher();
return $hasher->hash($value);
}
}
}