Add GDPR compliance: cookie consent banner, privacy checkbox, reCAPTCHA v3#265
Draft
Add GDPR compliance: cookie consent banner, privacy checkbox, reCAPTCHA v3#265
Conversation
…ration Agent-Logs-Url: https://github.com/danielmeppiel/corporate-website/sessions/cfcdab62-12a6-4cea-9f8b-641a6bfcc485 Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
… open for network errors Agent-Logs-Url: https://github.com/danielmeppiel/corporate-website/sessions/cfcdab62-12a6-4cea-9f8b-641a6bfcc485 Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update contact form for full GDPR compliance
Add GDPR compliance: cookie consent banner, privacy checkbox, reCAPTCHA v3
Mar 26, 2026
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.
Three GDPR elements were absent: no cookie consent mechanism, no explicit privacy checkbox on the contact form (despite backend requiring
consent_given), and no reCAPTCHA integration anywhere in the stack.Privacy consent checkbox
Added required
privacyConsentfield to bothContactForm.tsxandindex.html, wired toconsent_givenin the submission payload. Validation fails client-side if unchecked;contact_handler.pyalready enforced this server-side.Cookie consent banner
New
src/components/CookieConsent.tsxwith three categories (necessary/analytics/marketing), preferences persisted tolocalStorageasgdpr_cookie_consent. Vanilla JS equivalent rendered into#cookie-consent-bannerviamain.json first visit, withacceptAllCookies()/acceptNecessaryCookiesOnly()exposed globally.reCAPTCHA v3
src/hooks/useRecaptcha.ts— wrapswindow.grecaptcha.execute(); returns''gracefully when unavailable (test/dev environments)index.html— reCAPTCHA script addedasync defer, keyed offYOUR_RECAPTCHA_SITE_KEYplaceholder (replace withVITE_RECAPTCHA_SITE_KEYenv var)ContactForm.tsx— token obtained pre-submission and included in payload asrecaptchaTokenserver/contact_handler.py—verify_recaptcha_token()calls Google'ssiteverifyAPI; fails closed on malformed token responses, fails open on network errors (with audit log warnings); skips entirely whenRECAPTCHA_SECRET_KEYis unsetAPI contract update
ContactFormDatainsrc/api/contact.tsnow includesconsent_given: booleanandrecaptchaToken: string. Consent is validated before the fetch.Test infrastructure
ContactForm.tsxnow importssubmitContactForm/logAuditEventfrom../api/contact(replacing internal stubs), making the existing vi.mock interception work correctly. Addedtests/setup.tsfor@testing-library/jest-dom, configuredvite.config.jswithjsdomenvironment,jsxInject, and jest-domsetupFiles.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node node install.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.