From 0825d87d0f8f57ed7d4a47bba31e198c1e36530c Mon Sep 17 00:00:00 2001 From: toimistokone Date: Tue, 10 Mar 2026 17:01:26 +0200 Subject: [PATCH 1/4] antibot --- src/pages/signup/[id].tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 */} + + Date: Tue, 10 Mar 2026 17:45:42 +0200 Subject: [PATCH 2/4] eslint xD --- .eslintrc.js | 1 + src/pages/signup/[id].tsx | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d390281..e559c5b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -47,5 +47,6 @@ module.exports = { "jsx-a11y/no-noninteractive-element-interactions": "off", "jsx-a11y/no-static-element-interactions": "off", "@typescript-eslint/default-param-last": "warn", + "object-curly-newline": "warn", }, }; diff --git a/src/pages/signup/[id].tsx b/src/pages/signup/[id].tsx index 8c1c3af..0aaff70 100644 --- a/src/pages/signup/[id].tsx +++ b/src/pages/signup/[id].tsx @@ -47,7 +47,6 @@ 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 😎"); @@ -78,7 +77,11 @@ const SignUpPage: NextPage = ({ initialForm }) => { {/* 3. HONEYPOT INPUT FIELD */}