From e6e2bfdf300be659453cf2e1f041271161ecbe40 Mon Sep 17 00:00:00 2001 From: SebastEnn <103125747+SebastEnn@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:09:04 +0200 Subject: [PATCH] Fix password validation with uppercase and lowercase minimum requirements (#34152) Closes #34151 Signed-off-by: SebastEnn <103125747+SebastEnn@users.noreply.github.com> --- .../theme/keycloak.v2/login/resources/js/password-policy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/src/main/resources/theme/keycloak.v2/login/resources/js/password-policy.js b/themes/src/main/resources/theme/keycloak.v2/login/resources/js/password-policy.js index 466bcc6636..25542e3f1e 100644 --- a/themes/src/main/resources/theme/keycloak.v2/login/resources/js/password-policy.js +++ b/themes/src/main/resources/theme/keycloak.v2/login/resources/js/password-policy.js @@ -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);