From adaf3b15deb631a9939df25792ffa730908b566b Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 27 Jun 2024 12:39:44 +0530 Subject: [PATCH] [WEB-1746] fix: remove password validation for sign-in. (#4951) --- web/core/components/account/auth-forms/password.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/core/components/account/auth-forms/password.tsx b/web/core/components/account/auth-forms/password.tsx index 7645f1a94..a4c8b205d 100644 --- a/web/core/components/account/auth-forms/password.tsx +++ b/web/core/components/account/auth-forms/password.tsx @@ -137,7 +137,11 @@ export const AuthPasswordForm: React.FC = observer((props: Props) => { action={`${API_BASE_URL}/auth/${mode === EAuthModes.SIGN_IN ? "sign-in" : "sign-up"}/`} onSubmit={(event) => { event.preventDefault(); // Prevent form from submitting by default - if (getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID) { + const isPasswordValid = + mode === EAuthModes.SIGN_UP + ? getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID + : true; + if (isPasswordValid) { setIsSubmitting(true); captureEvent(mode === EAuthModes.SIGN_IN ? SIGN_IN_WITH_PASSWORD : SIGN_UP_WITH_PASSWORD); event.currentTarget.submit(); // Manually submit the form if the condition is met