abinnovision / vue-recaptcha-v3

A simple and easy to use reCAPTCHA (v3 only) library for Vue.
Apache License 2.0
241 stars 26 forks source link

Loading the recaptcha only in one page #642

Open erikas-tranauskas opened 2 years ago

erikas-tranauskas commented 2 years ago

Hello,

So I just started using the vue-recaptcha-v3 and I have a question. I want the reCAPTCHA badge to be visible only on login component. But somehow the badge appears on every other page too. How do I enable it only on one page?

One solution I can think of is to load the recaptcha with autoHideBadge: true like this: Vue.use(VueReCaptcha, { siteKey: '', loaderOptions: { autoHideBadge: true } })

And then show the badge on the page I want using: this.$recaptchaInstance.showBadge();

Of course this way the reCAPTCHA script still runs on every page of my site, it's just hidden. Is this ok that it's running on the whole site?

javl commented 2 years ago

I'm also wondering what would be the best way to handle this. It feels a bit wasteful to always initialize recaptcha when there is just one page that needs it, and only 1 in 100 visitors will come to this page.

jals1212 commented 1 year ago

https://github.com/AurityLab/vue-recaptcha-v3/issues/460#issuecomment-1382365512

Lisio commented 8 months ago

#460 (comment)

That comment is useless. We don't need to hide the badge. We just need to stop loading recaptcha on every single page. For vue2 package vue-recaptcha used it the right way.

codeflorist commented 2 months ago

check out this comment for a possible solution: https://github.com/AurityLab/vue-recaptcha-v3/issues/680#issuecomment-2360281430