Add Turnstile protection to UK MP email form - #1045
Open
hturnbull93 wants to merge 1 commit into
Open
Conversation
This form POSTs JSON directly to /api/uk-send-mp-email rather than going through a SvelteKit form action, so it had no anti-spam gate like the other forms. Adds the same honeypot + Turnstile check via a FormData shim into the shared checkNotSpam verifier. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MfJodwSCVy9tEABpf3nfn3
✅ Deploy Preview for pauseai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
@Wituareard might as well finish off the set |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
/uk-send-mp-emailform POSTs JSON straight to/api/uk-send-mp-email(not a SvelteKit form action), so it was missing the honeypot + Turnstile anti-spam gate the other forms have.UKMPEmailForm.svelte(shown in the confirm step, gates the send button) plus a honeypot field, and sends both to the API.FormDatashim so it can reuse the existing sharedcheckNotSpamverifier — same server-side check as contact-us and onboarding, no new spam logic.Test plan
svelte-check: 0 errorseslint: clean🤖 Generated with Claude Code
https://claude.ai/code/session_01MfJodwSCVy9tEABpf3nfn3