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

Nuxt 3 disable recapthca when needed #1299

Open
ks-neerajn opened this issue Aug 12, 2023 · 1 comment
Open

Nuxt 3 disable recapthca when needed #1299

ks-neerajn opened this issue Aug 12, 2023 · 1 comment

Comments

@ks-neerajn
Copy link

Describe the feature

I am using this like this.

nuxt.config.ts

image

and using the useRecaptchaprovider for initiallize the plugin in app.vue.

but I set NUXT_RECAPTCHA_ACTIVE = false in env, so got a error of 500
image

Because this requires a key and I need that I can set as false so it woudn't load when I no need.

@DanSnow
Copy link
Owner

DanSnow commented Jan 22, 2024

Try this. useRepcaptchaProvider performs the key check when you call it. You can just add a if to prevent this

if (process.env.NUXT_RECAPTCHA_ACTIVE) {
  useRecaptchaProvider()
}
`

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

No branches or pull requests

2 participants