Enhance Contact Form Security (Token + Validation)
This commit is contained in:
parent
70c340251e
commit
d012d83d64
@ -1,13 +1,16 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="ko">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>SmartBiz Tech - 소상공인 스마트 기술 파트너</title>
|
<title>SmartBiz Tech - 소상공인 스마트 기술 파트너</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script type="module" src="/src/main.jsx"></script>
|
<script type="module" src="/src/main.jsx"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -24,10 +24,18 @@ const Contact = () => {
|
|||||||
return;
|
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('전송 중...');
|
setStatus('전송 중...');
|
||||||
|
|
||||||
try {
|
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",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user