Enter키 동작 구현
This commit is contained in:
geonhee-min
2025-12-03 10:13:37 +09:00
parent 1a0cc9376f
commit 54c84dbc87
6 changed files with 52 additions and 16 deletions

View File

@@ -1,11 +1,20 @@
import { Validator } from '@/util/Validator';
import * as z from 'zod';
export const LoginSchema = z.object({
id: z
.string()
.refine((val) => {
if (val.includes('@')) {
return Validator.isEmail(val);;
}
return true;
}, {
message: "이메일 형식이 올바르지 않습니다."
})
, password: z
.string()
.min(8, "비밀번호는 8-12 자리여야 합니다.")
.max(12, "비밀번호는 8-12 자리여야 합니다.")
.regex(/^[a-z](?=.*[0-9])(?=.*[!@#$]).*$/, "비밀번호는 영소문자로 시작하여 숫자, 특수문자(!@#$)를 한 개 이상 포함하여야 합니다.")
.regex(/^(?=.*[0-9])(?=.*[!@#$%^])[a-zA-Z0-9!@#$%^]+$/, "비밀번호는 영소문자로 시작하여 숫자, 특수문자(!@#$)를 한 개 이상 포함하여야 합니다.")
});