From a3a669a5dc0e0bd740cdf1990562a39371be12fd Mon Sep 17 00:00:00 2001 From: MOON Date: Wed, 31 Jul 2024 23:01:58 +0900 Subject: [PATCH 1/9] =?UTF-8?q?:wrench:=20=EC=A0=95=EA=B7=9C=EC=8B=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit api 문서에서 제공하는 정규식 --- src/schema/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/auth.ts b/src/schema/auth.ts index 5de73332..5ace18f2 100644 --- a/src/schema/auth.ts +++ b/src/schema/auth.ts @@ -1,6 +1,6 @@ import * as z from 'zod'; -const PWD_VALIDATION_REGEX = /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{8,}$/; +const PWD_VALIDATION_REGEX = /^([a-z]|[A-Z]|[0-9]|[!@#$%^&])+$/; // NOTE: 회원가입 스키마 export const PostSignUpRequest = z From b451058644c659ffc32af35775a0b94c55e4e85f Mon Sep 17 00:00:00 2001 From: MOON Date: Wed, 31 Jul 2024 23:06:51 +0900 Subject: [PATCH 2/9] =?UTF-8?q?:sparkles:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=ED=8F=BC=20=EA=B3=B5=EB=B0=B1=20=EC=A0=9C=EA=B1=B0?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auth/SignUp.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/auth/SignUp.tsx b/src/pages/auth/SignUp.tsx index e6c52906..1cbc4ffa 100644 --- a/src/pages/auth/SignUp.tsx +++ b/src/pages/auth/SignUp.tsx @@ -22,6 +22,10 @@ export default function SignUp() { }, }); + const trimWhitespace = (fieldName: keyof PostSignUpRequestType, value: string) => { + form.setValue(fieldName, value.trim(), { shouldValidate: true, shouldDirty: true }); + }; + return (
@@ -44,6 +48,7 @@ export default function SignUp() { placeholder='이메일' className={`lg:h-16 h-11 px-4 lg:text-xl md:text-base placeholder-blue-400 rounded-xl bg-blue-200 font-pretendard ${fieldState.invalid ? 'border-2 border-state-error' : ''}`} {...field} + onBlur={(e) => trimWhitespace('email', e.target.value)} /> @@ -62,6 +67,7 @@ export default function SignUp() { placeholder='비밀번호' className={`lg:h-16 h-11 px-4 lg:text-xl md:text-base placeholder-blue-400 rounded-xl bg-blue-200 font-pretendard ${fieldState.invalid ? 'border-2 border-state-error' : ''}`} {...field} + onBlur={(e) => trimWhitespace('password', e.target.value)} /> @@ -79,6 +85,7 @@ export default function SignUp() { placeholder='비밀번호 확인' className={`lg:h-16 h-11 px-4 lg:text-xl md:text-base placeholder-blue-400 rounded-xl bg-blue-200 font-pretendard ${fieldState.invalid ? 'border-2 border-state-error' : ''}`} {...field} + onBlur={(e) => trimWhitespace('passwordConfirmation', e.target.value)} /> @@ -97,6 +104,7 @@ export default function SignUp() { placeholder='닉네임' className={`lg:h-16 h-11 px-4 lg:text-xl md:text-base placeholder-blue-400 rounded-xl bg-blue-200 font-pretendard ${fieldState.invalid ? 'border-2 border-state-error' : ''}`} {...field} + onBlur={(e) => trimWhitespace('nickname', e.target.value)} /> From 5506804ebe20d346b2e6f4851c406660832ac267 Mon Sep 17 00:00:00 2001 From: MOON Date: Thu, 1 Aug 2024 19:44:04 +0900 Subject: [PATCH 3/9] =?UTF-8?q?:lipstick:=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit input, textarea 컴포넌트 포커스 스타일 삭제 --- src/components/ui/input.tsx | 2 +- src/components/ui/textarea.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx index 8971384a..63a54c1d 100644 --- a/src/components/ui/input.tsx +++ b/src/components/ui/input.tsx @@ -8,7 +8,7 @@ const Input = React.forwardRef(({ className, type, (({ className, ...props }, ref) => (