From dc53a2588abcc3e256f9d9a4c781a07c0f0e28ba Mon Sep 17 00:00:00 2001 From: nalpari Date: Fri, 20 Jun 2025 10:16:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 비밀번호 길이, 대문자, 소문자, 숫자 포함 여부 체크 기능 구현 - 두 비밀번호 일치 여부 확인 로직 강화 --- src/components/pw-reset/PwResetForm.tsx | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/components/pw-reset/PwResetForm.tsx b/src/components/pw-reset/PwResetForm.tsx index b332de4..26d3415 100644 --- a/src/components/pw-reset/PwResetForm.tsx +++ b/src/components/pw-reset/PwResetForm.tsx @@ -21,10 +21,36 @@ export default function PwResetForm() { const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' }) const validatePwd = () => { + // 비밀번호 길이 체크 (8글자 이상) + if (pwd01.length < 8) { + alert('비밀번호는 8글자 이상이어야 합니다.') + return false + } + + // 영문 대문자 포함 체크 + if (!/[A-Z]/.test(pwd01)) { + alert('비밀번호에 영문 대문자를 포함해야 합니다.') + return false + } + + // 영문 소문자 포함 체크 + if (!/[a-z]/.test(pwd01)) { + alert('비밀번호에 영문 소문자를 포함해야 합니다.') + return false + } + + // 숫자 포함 체크 + if (!/[0-9]/.test(pwd01)) { + alert('비밀번호에 숫자를 포함해야 합니다.') + return false + } + + // 두 비밀번호 일치 체크 if (pwd01 !== pwd02) { alert('비밀번호가 일치하지 않습니다.') return false } + return true }