Skip to content

Commit

Permalink
Update PasswordExpireService.php
Browse files Browse the repository at this point in the history
Fix PasswordExpireService return error when user model attribute "password_changed_at" is already set at null.
  • Loading branch information
niciz authored Nov 21, 2023
1 parent 723ae81 commit 3d8c4c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/User/Service/PasswordExpireService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 3d8c4c7

Please sign in to comment.