cakephp-3-acl-example
cakephp-3-acl-example copied to clipboard
Password Hashing Step
In order to be able to update other user information without changing (or at least re-entering) a users password, I would suggest using the following in App\Model\Entity\User.php
protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
}
And change the "baked" line below in App\Model\Table\UsersTable.php:
->notEmpty('password');
to this:
->notEmpty('password', 'You must provide a password', 'create');
I would also note that someone should add 'value' => ''
anytime they use the Form helper to generate a field for updating the password.
Hope this is helpful.