captcha-eu / typo3

GNU General Public License v2.0
0 stars 2 forks source link

Add utilty ViewHelper to make use of captcha.eu in custom actions (not using the FormFramework) #11

Open MajPay opened 6 months ago

MajPay commented 6 months ago

The javascript could be generated by a viewhelper. By doing so one could very easily utilize the captcha-eu Extension to add the validation to arbitrary extbase controller action or domain model validations. In the moment you have to copy the whole javascript block, which is not very future-proof.

something like:

<captchaeu:init elementId="example-id">
    <f:form.hidden name="captcha" id="example-id" />
</captchaeu:init>

The ViewHelper would:

1) insert the form child markup (form element) 2) Load the config 3) add The script via the asset pipeline 4) generate the callback script for the provieded elementId

hjanuschka commented 6 months ago

hey 👋 @MajPay

i think i am not fully getting it, my typo3 in-depth know how is pretty limited (nackerbatzl) the idea of our integrations is that they are as un-intrusive as possible.

do i understand it right, that this would require the users/customers to add above snippets manually? (my understanding is that it should be enough to add the field via backend-ui)

do you mind crafting a PR - happy to review and accept?

MajPay commented 6 months ago

We provide web-solutions for our customers and i am adding captcha.eu support to some of our typo3 products. I wanted to use your "official" typo3 package as a basis and it works great so far! But using the form framework is only one situation where you want to add a captcha validation. When you provide a typo3 plugin to handle some api request initiated by the frontend user, you often want to secure it using a captcha. You can do this very easily by using your FormValidator and Configuration ViewHelper. But there is not utility to generate the callback script, so you need to hard-copy that snippet. A ViewHelper in your package could prevent integrators/developers from doing so...

I might find the time to create a PR. Thanks for your reply.

hjanuschka commented 6 months ago

got you! totally makes sense, i'll put this on our roadmap.