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 }