From 5b86cc75c94e2869fbbd2392d994bf1178e5ea0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Tue, 23 Jan 2024 15:34:07 +0000 Subject: [PATCH] Fix FLEXIAPI-133 Use the correct breadcrumb on create and fix a password update related issue on update - 1.4 --- flexiapi/app/Account.php | 2 +- flexiapi/app/Http/Controllers/Admin/AccountController.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flexiapi/app/Account.php b/flexiapi/app/Account.php index 3e22e05..1e388eb 100644 --- a/flexiapi/app/Account.php +++ b/flexiapi/app/Account.php @@ -345,7 +345,7 @@ class Account extends Authenticatable return !empty($this->recovery_code) && $this->updated_at->greaterThan($oneHourAgo); } - public function updatePassword($newPassword, ?string $algorithm = null) + public function updatePassword(string $newPassword, ?string $algorithm = null) { $algorithm = $algorithm ?? config('app.account_default_password_algorithm'); diff --git a/flexiapi/app/Http/Controllers/Admin/AccountController.php b/flexiapi/app/Http/Controllers/Admin/AccountController.php index 80f1482..39f2371 100644 --- a/flexiapi/app/Http/Controllers/Admin/AccountController.php +++ b/flexiapi/app/Http/Controllers/Admin/AccountController.php @@ -136,7 +136,10 @@ class AccountController extends Controller $account->phone = $request->get('phone'); - $account->updatePassword($request->get('password')); + if ($request->get('password')) { + $account->updatePassword($request->get('password')); + } + $account->setRole($request->get('role')); Log::channel('events')->info('Web Admin: Account updated', ['id' => $account->identifier]);