Fix password validation with uppercase and lowercase minimum requirements (#34152)

Closes #34151

Signed-off-by: SebastEnn <103125747+SebastEnn@users.noreply.github.com>
This commit is contained in:
SebastEnn 2024-10-23 12:09:04 +02:00 committed by GitHub
parent d900397d6f
commit e6e2bfdf30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ const policies = {
},
upperCase: (policy, value) => {
if (
value.split("").filter((char) => char !== char.toUpperCase()).length >
value.split("").filter((char) => char === char.toUpperCase() && char !== char.toLowerCase()).length <
policy.value
) {
return templateError(policy);
@ -19,7 +19,7 @@ const policies = {
},
lowerCase: (policy, value) => {
if (
value.split("").filter((char) => char !== char.toLowerCase()).length >
value.split("").filter((char) => char === char.toLowerCase() && char !== char.toUpperCase()).length <
policy.value
) {
return templateError(policy);