From 6c220986af3d317c18211b372e58acf7b5b9d829 Mon Sep 17 00:00:00 2001 From: Prabhat Kumar Date: Sun, 6 Oct 2024 17:58:59 +0800 Subject: [PATCH] bug fixes --- frontend/.env.sample | 6 ++++-- frontend/src/util/user.helper.ts | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/.env.sample b/frontend/.env.sample index 4914d55212..a22167caa4 100644 --- a/frontend/.env.sample +++ b/frontend/.env.sample @@ -1,6 +1,8 @@ PORT=3000 -REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002 -REACT_APP_USER_SERVICE_URL=http://localhost:3001 + +# local server addresses +# REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002 +# REACT_APP_USER_SERVICE_URL=http://localhost:3001 # In docker REACT_APP_QUESTION_SERVICE_URL=http://localhost/api/questions/ diff --git a/frontend/src/util/user.helper.ts b/frontend/src/util/user.helper.ts index e520f7a532..298dba86d6 100644 --- a/frontend/src/util/user.helper.ts +++ b/frontend/src/util/user.helper.ts @@ -42,10 +42,7 @@ export const validatePassword = (password: string): string | null => { if (!password) { return "Password is required."; } - const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/; - return passwordRegex.test(password) - ? null - : "Password must be at least 8 characters long and contain letters and numbers."; + return password.length >= 8 ? null : "Password must be at least 8 characters long"; }; export const validateAvatar = (avatar: string): string | null => {