Enhance Contact Form Security (Token + Validation)
This commit is contained in:
parent
70c340251e
commit
d012d83d64
27
index.html
27
index.html
@ -1,13 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>SmartBiz Tech - 소상공인 스마트 기술 파트너</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>SmartBiz Tech - 소상공인 스마트 기술 파트너</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -24,10 +24,18 @@ const Contact = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. Phone Validation
|
||||
const phoneRegex = /^01([0|1|6|7|8|9])-?([0-9]{3,4})-?([0-9]{4})$/;
|
||||
if (!phoneRegex.test(formData.phone)) {
|
||||
setStatus('올바른 휴대전화 번호 형식을 입력해주세요 (예: 010-1234-5678)');
|
||||
return;
|
||||
}
|
||||
|
||||
setStatus('전송 중...');
|
||||
|
||||
try {
|
||||
const response = await fetch("https://formsubmit.co/ajax/contact@qideun.com", {
|
||||
// Use Token instead of Email for security
|
||||
const response = await fetch("https://formsubmit.co/ajax/212b91b0ad256186720580d133b7a9e4", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user