Feat: Replace Google ReCAPTCHA with ALTCHA using API - non-tracking, GDPR compliant without cookies or fingerprinting.

This commit is contained in:
2025-03-13 15:36:41 +00:00
parent 29205de12f
commit b843849af9
12 changed files with 2856 additions and 722 deletions

View File

@@ -10,9 +10,32 @@ export default class PageContact extends BasePage {
initialize() {
this.sharedInitialize();
this.hookupCaptcha();
this.hookupButtonSubmitFormContactUs();
}
hookupCaptcha() {
const form = document.querySelector(idContactForm);
const altchaWidget = form.querySelector('altcha-widget');
// Listen for verification events from the ALTCHA widget
if (altchaWidget) {
altchaWidget.addEventListener('serververification', function(event) {
// Create or update the hidden input for ALTCHA
let altchaInput = form.querySelector('input[name="altcha"]');
if (!altchaInput) {
altchaInput = document.createElement('input');
altchaInput.type = 'hidden';
altchaInput.name = 'altcha';
form.appendChild(altchaInput);
}
// Set the verification payload
altchaInput.value = event.detail.payload;
});
}
}
hookupButtonSubmitFormContactUs() {
const button = document.querySelector('form input[type="submit"]');
button.classList.add(flagButton);