feat: checking referrer request

This and CORS should at least filter out most potential errors. Plus
some cloudflare protections should be OK.

Could even add captcha
This commit is contained in:
2025-11-15 11:51:00 +00:00
parent a31d81dd3f
commit f84ec38af3
2 changed files with 17 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ const signedPetitionSignatures = z.array(signedPetitionWithParsedDate);
export const getSignatures = async (): Promise<
z.infer<typeof signedPetitionSignatures>
> => {
const res = await fetch(`${backendUrl}/sign`);
const res = await fetch(`${backendUrl}/sign`, { referrer: location.origin });
const body = await res.json();
const validatedBody = signedPetitionSignatures.parse(body);