diff --git a/src/pages/signup/[id].tsx b/src/pages/signup/[id].tsx index 855aff5..8c1c3af 100644 --- a/src/pages/signup/[id].tsx +++ b/src/pages/signup/[id].tsx @@ -23,6 +23,9 @@ const FORM_URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`; const SignUpPage: NextPage = ({ initialForm }) => { const router = useRouter(); + + const [honeypot, setHoneypot] = useState(""); + const id = String(initialForm?.id ?? ""); const SUBMIT_ID = uuid(); // Submission key, generated on page refresh const URL = `${FORM_URL}${id}/`; @@ -44,6 +47,13 @@ const SignUpPage: NextPage = ({ initialForm }) => { } const onSubmit = async ({ formData }: ISubmitEvent) => { + + if (honeypot !== "") { + console.log("bot cought in honeypot cought lacking"); + toast.success("Sign-up submitted successfully 😎"); + return; + } + const payload: Signup = { submit_id: SUBMIT_ID, // This is for preventing duplicate requests; NOT RELATED TO THE SIGNUP ID IN DATABASE signupForm_id: signupForm.id, @@ -66,6 +76,23 @@ const SignUpPage: NextPage = ({ initialForm }) => { + {/* 3. HONEYPOT INPUT FIELD */} + +