Merge branch 'master' into 'production'
Bot honeypot & 2026 kunniamaininnat See merge request sahkoinsinoorikilta/vtmk/web2.0-frontend!203
This commit is contained in:
@@ -47,5 +47,9 @@ 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",
|
||||
"no-mixed-spaces-and-tabs": "warn",
|
||||
"no-tabs": "warn",
|
||||
"react/jsx-indent": "warn",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -43,6 +43,7 @@ const StyledCard = styled.article`
|
||||
}
|
||||
|
||||
h3 {
|
||||
hyphens: auto;
|
||||
padding: 0.5rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 300;
|
||||
|
||||
@@ -23,6 +23,9 @@ const FORM_URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`;
|
||||
|
||||
const SignUpPage: NextPage<InitialProps> = ({ 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,12 @@ const SignUpPage: NextPage<InitialProps> = ({ initialForm }) => {
|
||||
}
|
||||
|
||||
const onSubmit = async ({ formData }: ISubmitEvent<string>) => {
|
||||
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,
|
||||
@@ -72,6 +81,26 @@ const SignUpPage: NextPage<InitialProps> = ({ initialForm }) => {
|
||||
onChange={noop}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
{/* 3. HONEYPOT INPUT FIELD */}
|
||||
<div
|
||||
style={
|
||||
{
|
||||
position: "absolute", top: "-9999px", left: "-9999px", opacity: 0,
|
||||
}
|
||||
}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<label htmlFor="website_url">Do not fill this out if you are human</label>
|
||||
<input
|
||||
id="website_url"
|
||||
type="text"
|
||||
name="website_url"
|
||||
value={honeypot}
|
||||
onChange={(e) => setHoneypot(e.target.value)}
|
||||
tabIndex={-1} // Removes it from the "tab" cycle so keyboard users don't hit it
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
</PageWrapper>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -40,7 +40,8 @@ const HonoraryPageView: React.FC = () => (
|
||||
<li>Keijo Nikoskinen 2011–2014</li>
|
||||
<li>Jussi Ryynänen 2014–2017</li>
|
||||
<li>Ville Viikari 2017–2020</li>
|
||||
<li>Anu Lehtovuori 2020–</li>
|
||||
<li>Anu Lehtovuori 2020–2026</li>
|
||||
<li>Marko Hinkkanen 2026-</li>
|
||||
</ul>
|
||||
<h2>Pro SIK</h2>
|
||||
<p>
|
||||
@@ -91,6 +92,8 @@ const HonoraryPageView: React.FC = () => (
|
||||
<li>2023 Emmaleena Ahonen</li>
|
||||
<li>2024 Jonna Tammikivi</li>
|
||||
<li>2025 Eveliina Ahonen</li>
|
||||
<li>2026 Otto Julkunen</li>
|
||||
<li>2026 Melisa Dönmez</li>
|
||||
</ul>
|
||||
<h2>Standaari</h2>
|
||||
<p>Standaari voidaan hallituksen päätöksellä lahjoittaa killan toimintaan myönteisesti vaikuttaneille tahoille. Standaarit on numeroitu lahjoittamisjärjestyksessä.</p>
|
||||
@@ -233,6 +236,12 @@ const HonoraryPageView: React.FC = () => (
|
||||
<li>2025 Iikka Huttu</li>
|
||||
<li>2025 Heidi Mäkitalo</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>2026 Aaron Löfgren</li>
|
||||
<li>2025 Elina Huttunen</li>
|
||||
<li>2026 Karoliina Talvikangas</li>
|
||||
<li>2026 Tommi Sytelä</li>
|
||||
</ul>
|
||||
<h2>Hopeiset ansiomerkit</h2>
|
||||
<p>Killan hallitus voi myöntää hopeisen ansiomerkin killan jäsenelle tai perustellusta syystä myös muulle henkilölle tunnustuksena erityisestä kiinnostuksesta kiltaa kohtaan sekä ansioituneesta toiminnasta killan hyväksi.</p>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user