From e99fe591b3a4e510deab95162c3f632562f532e7 Mon Sep 17 00:00:00 2001 From: naumov Date: Thu, 18 Jan 2024 13:48:33 +0100 Subject: [PATCH 1/2] CB-4534 do not validate empty password, required attribute will --- webapp/packages/core-authentication/src/usePasswordPolicy.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/packages/core-authentication/src/usePasswordPolicy.ts b/webapp/packages/core-authentication/src/usePasswordPolicy.ts index fed5237589..ebe6ca4687 100644 --- a/webapp/packages/core-authentication/src/usePasswordPolicy.ts +++ b/webapp/packages/core-authentication/src/usePasswordPolicy.ts @@ -14,6 +14,10 @@ export function usePasswordPolicy() { const passwordPolicyService = useService(PasswordPolicyService); const ref = useCustomInputValidation(value => { + if (!value.trim()) { + return null; + } + const validation = passwordPolicyService.validatePassword(value); return validation.isValid ? null : validation.errorMessage; }); From fa774675811c6b13a5271b6e0393f0680ef75170 Mon Sep 17 00:00:00 2001 From: naumov Date: Thu, 18 Jan 2024 13:52:27 +0100 Subject: [PATCH 2/2] CB-4534 remove trim --- webapp/packages/core-authentication/src/usePasswordPolicy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/packages/core-authentication/src/usePasswordPolicy.ts b/webapp/packages/core-authentication/src/usePasswordPolicy.ts index ebe6ca4687..2f73d0d4b2 100644 --- a/webapp/packages/core-authentication/src/usePasswordPolicy.ts +++ b/webapp/packages/core-authentication/src/usePasswordPolicy.ts @@ -14,7 +14,7 @@ export function usePasswordPolicy() { const passwordPolicyService = useService(PasswordPolicyService); const ref = useCustomInputValidation(value => { - if (!value.trim()) { + if (!value) { return null; }