FormEasy icon indicating copy to clipboard operation
FormEasy copied to clipboard

🚀 Feature: Captcha verification

Open Meldiron opened this issue 3 years ago • 1 comments

To prevent spamming, some contact forms implement human verification tools such as reCAPTCHA v2, hCaptcha, and others.

I am proposing a feature in FormEasy to allow communication with these captcha servers to validate form submissions.

One way of implementing it I can see is to update FormEasy.action(req); function with new options parameter:

const options = {
  captcha: "recaptcha_v2",
  captchaConfig: { secretKey: "........." }
};

FormEasy.action(req, options);

FormEasy would then look for proper implementation of specific captcha on a website.. That can be verified by looking at JSON data, and for instance, looking for g-recaptcha-response key in the case of Recaptcha V2.

Finally FormEasy talks to API servers to verify the token from captcha.

(all of that properly documented, of course)

Would you be interested in this feature inside FormEasy? I would love to contribute to this feature in my free time.

Meldiron avatar Jun 11 '22 13:06 Meldiron

Hi Meldiron,

So glad to see the first contribution request :)

Having a spam filter while submitting these forms is a great idea. Please add whatever you think is relevant to implement this feature.

For testing it you can do it directly inside the doPost function while using this library and once it works fine include that code in main Code.js file of this library and make a pull request and I'll verify the same from my end and then make a new version to this library with this feature.

Thank you for taking the time to contact and feel free to make your contributions to make this useful for all.

See you!

Basharath avatar Jun 12 '22 05:06 Basharath

Captcha validation is available through FormEasy version 2.

Basharath avatar Aug 22 '22 07:08 Basharath