Fix user password handling in Admin CP
This commit is contained in:
parent
e49c739bde
commit
dd54c5abb1
3 changed files with 24 additions and 5 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue