Skip to content

Commit

Permalink
assert also old password complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 2, 2024
1 parent 1d2ba28 commit 362b586
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public function changePassword(AccountChangePassword $changePassword, UserContex
}

// assert password complexity
$this->validator->assertPassword($oldPassword);
$this->validator->assertPassword($newPassword);

// change password
Expand Down
2 changes: 1 addition & 1 deletion src/Service/User/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function assertPassword($password, $minLength = null, $minAlpha = null, $
$minNumeric = $minNumeric ?? 0;
$minSpecial = $minSpecial ?? 0;

// it is not possible to user passwords which have less then 8 chars
// it is not possible to use passwords which have less than 8 chars
if ($minLength < 8) {
$minLength = 8;
}
Expand Down

0 comments on commit 362b586

Please sign in to comment.