diff --git a/support/cas-server-support-thymeleaf/src/main/resources/static/js/passwordMeter.js b/support/cas-server-support-thymeleaf/src/main/resources/static/js/passwordMeter.js index 9c340fd9bac0..a3c787312b50 100644 --- a/support/cas-server-support-thymeleaf/src/main/resources/static/js/passwordMeter.js +++ b/support/cas-server-support-thymeleaf/src/main/resources/static/js/passwordMeter.js @@ -115,10 +115,11 @@ function jqueryReady() { let passwordPolicyViolated = val === '' || !policyPatternRegex.test(val); let passwordMismatch = val !== '' && val !== cnf; - let disableSubmit = passwordPolicyViolated || passwordMismatch; + let result = zxcvbn(val); + let passwordTooWeak = passwordMinimumStrength > result.score; + let disableSubmit = passwordPolicyViolated || passwordMismatch || passwordTooWeak; $('#submit').prop('disabled', disableSubmit); - let result = zxcvbn(val); $('#strengthProgressBar').zxcvbnProgressBar({ passwordInput: 'password', bar: bar }); // Check strength, update the text indicator diff --git a/support/cas-server-support-thymeleaf/src/main/resources/templates/fragments/pwdupdateform.html b/support/cas-server-support-thymeleaf/src/main/resources/templates/fragments/pwdupdateform.html index ad9fe5b13fa2..6fff75609ab4 100644 --- a/support/cas-server-support-thymeleaf/src/main/resources/templates/fragments/pwdupdateform.html +++ b/support/cas-server-support-thymeleaf/src/main/resources/templates/fragments/pwdupdateform.html @@ -24,6 +24,7 @@ 3: /*[[#{screen.pm.password.strength.3}]]*/, 4: /*[[#{screen.pm.password.strength.4}]]*/ }; + let passwordMinimumStrength = 0; /*]]>*/