plain-solutions-gmbh / kirby-form-block-suite

This form plugin for Kirby offers you maximum flexibility and usability. It can be used as a block anywhere you needed. This repository replaces the obsolete version 2.0.
Other
38 stars 11 forks source link

Help integrating Cloudflare Turnstile? #54

Closed brandsis closed 1 month ago

brandsis commented 1 month ago

Hi, Roman.

On my own website, I have your spam protection field added and I'm happy with it. But I have a couple of charity clients that I am migrating to Kirby and one of those is a dementia-related charity. They're not keen on the maths problem CAPTCHA because asking someone to complete a maths problem, however simple, is not the right thing for a dementia-focussed website. As a result, I've been looking at implementing Cloudflare Turnstile.

I can get the client-side rendering working by using JavaScript to insert the Turnstile script, the form widget and an action attribute to the form element on my TEST site.

It's the server-side validation that's the challenge. I found a relevant tutorial and even reached out to the author. Of course, the form processing doesn't use the action instruction and so the call to the Cloudflare servers to get the validation response doesn't happen.

The tutorial author's advice was to... "hook into the form plugin's validation code, so that it can run the CF validation code first (and trigger error/redirect upon failure), followed by its own validation/email tasks upon success. This way, you won't need your JS hacks and can ensure the validation flow is correct." But that's beyond my level of expertise.

Is this something you'd be able to help with? I'm keen to have Turnstile as an option. And I think it would be a useful addition to the plugin.

Many thanks.

plain-solutions-gmbh commented 1 month ago

Dear Brandsis

Your request goes far beyond the support of this plugin. Unfortunately, I cannot offer you any support here.

Thank you for your understanding.

brandsis commented 1 month ago

Thanks, Roman. Understood. I'll try to figure it out.