Skip to content

Password Hashing Step #7

@temp1029

Description

@temp1029

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions