From 3d8c4c747d1f8cc249f8bba2da68097dfa9a73b8 Mon Sep 17 00:00:00 2001 From: niciz Date: Tue, 21 Nov 2023 14:19:17 +0100 Subject: [PATCH] Update PasswordExpireService.php Fix PasswordExpireService return error when user model attribute "password_changed_at" is already set at null. --- src/User/Service/PasswordExpireService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/User/Service/PasswordExpireService.php b/src/User/Service/PasswordExpireService.php index bfec3f7c..77470450 100644 --- a/src/User/Service/PasswordExpireService.php +++ b/src/User/Service/PasswordExpireService.php @@ -25,8 +25,11 @@ public function __construct(User $model) public function run() { - return $this->model->updateAttributes([ - 'password_changed_at' => null, - ]); + if ($this->model->password_changed_at !== null) { + return $this->model->updateAttributes([ + 'password_changed_at' => null, + ]); + } + return true; } }