Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.$recaptcha.destroy() is not removing the recaptcha scripts or badge #126

Open
kangelopoulos opened this issue Sep 13, 2023 · 0 comments

Comments

@kangelopoulos
Copy link

kangelopoulos commented Sep 13, 2023

I'm encountering a problem in Nuxt 2 where the this.$recaptcha.destroy() function is not destroying the scripts.

I've called this function according to the documentation:

beforeDestroy() {
console.log('destroy me')
this.$recaptcha.destroy()
},

Screen Shot 2023-09-13 at 4 39 33 PM

The console log executes, so I know the beforeDestroy hook is being called. But the badge doesn't disappear. No errors fire in the console.

These are my options in my nuxt config file:

recaptcha: {
hideBadge: false, // tried to change this to true just to see if it would work, still didn't work
language: 'en' // added this after I noticed this issues just in case, still didn't work
mode: 'enterprise',
siteKey: env-key,
version: 3,
size: 'invisible'
},

Here's the badge still in the HTML after calling the destroy function:
Screen Shot 2023-09-13 at 4 56 22 PM

Here you can see it's still present in memory. One web worker that is connected to the recaptcha does disappear here when calling the destroy function.
Screen Shot 2023-09-13 at 4 58 50 PM

I am calling the reset function prior to calling the destroy function as the documentation states. Everything works perfectly except for the destroy function.

I'm using nuxt version 2.15.8 and the latest recaptcha version.

We don't want the recaptcha running on any page except for the registration page.

Any chance anyone knows what might be going wrong? I can just use DOM manipulation to get rid of it but I'd rather figure out the root cause of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant