FormEasy icon indicating copy to clipboard operation
FormEasy copied to clipboard

Feat: Recaptcha validation

Open Meldiron opened this issue 2 years ago • 5 comments

Hey there 👋 I have created an implementation for Google reCAPTCHA V2 so we can start the code review process.

When we agree on the structure, let's keep the PR open and I will implement more providers before the final review and merge.

I did manual QA with solution in this PR and was able to get it working on my demo application:

CleanShot 2022-06-12 at 10 47 29@2x CleanShot 2022-06-12 at 10 47 18@2x

Related to issue https://github.com/Basharath/FormEasy/issues/1

Meldiron avatar Jun 12 '22 09:06 Meldiron

One concern you might have is why I named the parameter g-recaptcha-response (in readme, step 6. also Code.js line 105).

This name comes from Google Docs, and while we could easily rename it to something simpler, I find it important to stay as close to the native solution as possible. That will help people experienced with Google reCAPTCHA to easily use it in FormEasy without having to scan docs.

On the other hand, this will create inconsistency between different captcha providers. This could be a valid reason to try to use specific words for all of them, like captcha. But with that, if some provider requires more than just a string response, we would make it a mess and people would have to learn how to pass it into FormEasy.


I would love to hear your feedback on this.

Meldiron avatar Jun 12 '22 09:06 Meldiron

Hey @Basharath 👋 What do you think about PR - all good? Can I start implementing more adapters to support more captcha providers?

Meldiron avatar Jun 21 '22 07:06 Meldiron

Hey @Meldiron I was waiting to hear from you about that.

It is all good so far, I haven't merged yet. Please add all the providers you want and then tell me so we can finalize the merge. Thanks!

Basharath avatar Jun 21 '22 07:06 Basharath

Awesome, I'll do so in the upcoming days. Ill also take my time with research to see what Captcha providers are most commonly used.

Meldiron avatar Jun 21 '22 08:06 Meldiron

Yeah, that's fine, you can take your time. Once done just update here.

Basharath avatar Jun 21 '22 08:06 Basharath

any ETA on merging of this PR?

I am looking to use FormEasy with reCAPTCHA. Without CAPTCHA, it's just too much spam.

scottydelta avatar Aug 18 '22 22:08 scottydelta

I won't be able to research other providers any time soon. With that said, reCAPTCHA is properly implemented and tested. This PR can be merged, in my opinion. In the future, I will open a new PR to add new providers.

Let me ping @Basharath about this.

Meldiron avatar Aug 19 '22 14:08 Meldiron

Hey, @Meldiron I thought to ask you about this a few days ago, meanwhile, this happened.

I'll try merging this by this weekend and publish the new update.

Basharath avatar Aug 19 '22 14:08 Basharath