appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.95k stars 3.66k forks source link

[Feature] Support for Google Recaptcha V2 in Button Widget #5553

Closed tomjose92 closed 3 years ago

tomjose92 commented 3 years ago

Summary

Support for Google ReCaptcha V2 on AppSmith.

Motivation

Currently Appsmith supports ReCaptcha v3. But many applications are still using ReCaptcha v2 and it would be great to see that being supported in appsmith, during the POC process, before we decide to switch to v3 to be more feasible with appsmith.

Additional Context

Currently on passing ReCaptcha v2 key instead, the https://www.google.com/recaptcha/api2/userverify api is being triggered (as seen in network tab) and a response is received. The captcha is just not being set in the [Button].recaptchaToken param. Hence I am requesting for this feature, hoping that it would be a quick action item to make it feasible with the appsmith workflow.

somangshu commented 3 years ago

Hi @tomjose92, Thanks for feature request 😄

Need a small clarification; Is the requirement only to set Button.recaptchaToken with the token received in response or is there anything else we need to add/change to make this work?

tomjose92 commented 3 years ago

@somangshu, we just need to set the button recaptchaToken with the value. Nothing else.

tomjose92 commented 3 years ago

Hi, any updates on this functionality?

somangshu commented 3 years ago

Hey @tomjose92, we are working on this, we have a Deploy Preview ready with the functionality. Do test it out if possible and let us know any changes/issues you think we should address.

We will try and ship this in the current week itself!

tomjose92 commented 3 years ago

Can I point my client side to this server?

somangshu commented 3 years ago

This Preview is also pointing to the release server. We use this server only for development work. I suggest you to not use this for any production based applications.

tomjose92 commented 3 years ago

I tried pointing my client side to the Netlify url you mentioned, the reCaptcha changes weren't working. But it's working when i create a project directly on the Netlify url.

somangshu commented 3 years ago

Since this is a client side change which is still not merged into release pointing the server is not going to help. If you are trying this in your local development environment you will have to checkout the branch in the PR to actually see the changes locally. I need to understand better what exactly you are trying to achieve here to help you out better!

Did you try out re-captcha v2 on the Netlify URL (Deploy preview). Did it work for you as per the expectations?

tomjose92 commented 3 years ago

I had checked out the branch also earlier locally, but it wasn’t working. Let me try that again. But yes, in the deploy Netlify app I was able to see it working.

somangshu commented 3 years ago

Got it, Thanks for the info. We are actually making a few more changes to make re-captcha v2 work end to end. I will keep you posted here.

tomjose92 commented 3 years ago

I checked out the PR branch, and pointed to Netlify server. It wasnt working then.

somangshu commented 3 years ago

The PR branch is supposed to point to https://release.app.appsmith.com.

Docs

tomjose92 commented 3 years ago

Tried the same. I see in the network tab its sending two apis, one which is the v2 captcha api, and the other is the custom API having param button.recaptchaToken as null.

somangshu commented 3 years ago

Hey @tomjose92 apologies for all the to(s) and fro(s). We have now finally made the changes required to accommodate captcha V2 and you can check it out here.

We have introduced a toggle option right below the captcha input to enable V2. We are almost done testing and should probably initiate the process to ship this to prod by tomorrow.

Do give it a try and let us know your feedback. 😄

tomjose92 commented 3 years ago

Pulled your latest changes from the PR branch. It worked perfectly. Thanks a lot @vicky-primathon @vivekverma2312 @somangshu @Nikhil-Nandagopal for the quick support on this. I shall wait for it to get merged to your release branch as well. Cheers 🍻

somangshu commented 3 years ago

Hey @tomjose92, Happy to tell you that this feature is now in the release environment 🎉

We will ship it to Production at the soonest 💙