From cb64f7f76c3509d9da2555838fdb306471c0b937 Mon Sep 17 00:00:00 2001 From: Richard Bergsma Date: Thu, 26 Jun 2025 22:38:06 +0200 Subject: [PATCH] Enhance ContactForm and CookieBanner components for improved accessibility and user feedback - Added CSRF token handling in the ContactForm for enhanced security. - Introduced a feedback div for displaying form submission results instead of alerts. - Updated the CookieBanner to include ARIA roles and improved focus management for better accessibility. - Refactored manual review email handling to escape HTML special characters, enhancing security. --- src/components/ContactForm.astro | 33 +++++++++++++++++++++----- src/components/CookieBanner.astro | 6 +++++ src/pages/api/contact.ts | 2 +- src/pages/api/contact/manual-review.ts | 17 ++++++++++--- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/components/ContactForm.astro b/src/components/ContactForm.astro index 0468e0e..f8ef31c 100644 --- a/src/components/ContactForm.astro +++ b/src/components/ContactForm.astro @@ -1,4 +1,5 @@
+
Enter your email address
@@ -8,7 +9,9 @@
-