From 80ce154b034ba5e85fe197334d11ccb02410fc4e Mon Sep 17 00:00:00 2001 From: alex <48489896+devnaumov@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:19:38 +0100 Subject: [PATCH] CB-4534 do not validate empty password, required attribute will (#2309) * CB-4534 do not validate empty password, required attribute will * CB-4534 remove trim --- 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..2f73d0d4b2 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) { + return null; + } + const validation = passwordPolicyService.validatePassword(value); return validation.isValid ? null : validation.errorMessage; });