vue-recaptcha-v3 icon indicating copy to clipboard operation
vue-recaptcha-v3 copied to clipboard

Loading the recaptcha only in one page

Open erikas-tranauskas opened this issue 2 years ago • 4 comments

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?

erikas-tranauskas avatar Jul 26 '22 12:07 erikas-tranauskas

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.

javl avatar Sep 07 '22 19:09 javl

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

jals1212 avatar Jan 13 '23 20:01 jals1212

#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.

Lisio avatar Apr 06 '24 14:04 Lisio