Fix user password handling in Admin CP

This commit is contained in:
Dane Everitt 2018-02-07 21:13:40 -06:00
parent e49c739bde
commit dd54c5abb1
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 24 additions and 5 deletions

View file

@ -58,8 +58,10 @@ class UserUpdateService
*/
public function handle(User $user, array $data): Collection
{
if (array_has($data, 'password')) {
if (! empty(array_get($data, 'password'))) {
$data['password'] = $this->hasher->make($data['password']);
} else {
unset($data['password']);
}
if ($this->isUserLevel(User::USER_LEVEL_ADMIN)) {