Skip to content

Commit 65c49c4

Browse files
committed
fix: 비밀번호 정규식 특수문자 제거, 영문 숫자만 가능
1 parent 7f687bc commit 65c49c4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/utils/validateInput.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const validateEmail = (value: string) => {
44
if (!value) return '이메일은 필수 입력입니다.';
5-
const regex = /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/;
5+
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
66
if (!regex.test(value)) return '이메일 형식으로 작성해 주세요.';
77
return '';
88
};
@@ -16,9 +16,8 @@ const validateNickname = (value: string) => {
1616
const validatePassword = (value: string) => {
1717
if (!value) return '비밀번호는 필수 입력입니다.';
1818
if (value.length < 8) return '8자 이상 작성해 주세요.';
19-
const regex = /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&*?_]).{8,16}$/;
20-
if (!regex.test(value))
21-
return '비밀번호는 숫자, 영문, 특수문자가 조합돼야 합니다.';
19+
const regex = /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,}$/;
20+
if (!regex.test(value)) return '비밀번호는 숫자와 영문이 포함되어야 합니다.';
2221
return '';
2322
};
2423

0 commit comments

Comments
 (0)