X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/7a8505f812bb430394aa218cd477422b2beaf9df..refs/pull/3918/head:/app/Auth/UserRepo.php diff --git a/app/Auth/UserRepo.php b/app/Auth/UserRepo.php index 28ce96c49..78bcb978e 100644 --- a/app/Auth/UserRepo.php +++ b/app/Auth/UserRepo.php @@ -10,6 +10,7 @@ use BookStack\Exceptions\UserUpdateException; use BookStack\Facades\Activity; use BookStack\Uploads\UserAvatars; use Exception; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; @@ -61,7 +62,7 @@ class UserRepo $user = new User(); $user->name = $data['name']; $user->email = $data['email']; - $user->password = bcrypt(empty($data['password']) ? Str::random(32) : $data['password']); + $user->password = Hash::make(empty($data['password']) ? Str::random(32) : $data['password']); $user->email_confirmed = $emailConfirmed; $user->external_auth_id = $data['external_auth_id'] ?? ''; @@ -126,7 +127,7 @@ class UserRepo } if (!empty($data['password'])) { - $user->password = bcrypt($data['password']); + $user->password = Hash::make($data['password']); } if (!empty($data['language'])) { @@ -157,6 +158,9 @@ class UserRepo // Delete user profile images $this->userAvatar->destroyAllForUser($user); + // Delete related activities + setting()->deleteUserSettings($user->id); + if (!empty($newOwnerId)) { $newOwner = User::query()->find($newOwnerId); if (!is_null($newOwner)) {