Skip to content

Commit

Permalink
Fixes client side password checks.
Browse files Browse the repository at this point in the history
If the settings require letters AND digits, false must be returned if either of the conditions are not fulfilled. Same goes of upper and lower case requirements.

Fixes: SE-14149
  • Loading branch information
fhaScireum committed Nov 25, 2024
1 parent c6dab63 commit bec35fa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
return false;
}

if (settings.requireLettersAndDigits && !/\d/.test(password) && !/[a-zA-Z]/.test(password)) {
if (settings.requireLettersAndDigits && (!/\d/.test(password) || !/[a-zA-Z]/.test(password))) {
return false;
}

if (settings.requireUpperAndLowerCase && !/[a-z]/.test(password) && !/[A-Z]/.test(password)) {
if (settings.requireUpperAndLowerCase && (!/[a-z]/.test(password) || !/[A-Z]/.test(password))) {
return false;
}

Expand Down

0 comments on commit bec35fa

Please sign in to comment.