nuxt-community/recaptcha-module

Unable to load script with V2 Enterprise

afiqiqmal opened this issue · 2 comments

https://www.google.com/recaptcha/enterprise.js?render=KEY will give error. Any workaround?

Hello, what's the error?

If you have enterprise v2 key,

https://www.google.com/recaptcha/enterprise.js?render=KEY will give 400 bad request

To make it works with this library. i have to do some trick where you cannot put siteKey in nuxt.config.js

recaptcha: {
    siteKey: 'explicit',  // put anything beside key
    version: 2,
    mode: 'enterprise'
},

In component:

<recaptcha id="v2-normal"/>
await this.$recaptcha.init()
this.widgetId = this.$recaptcha.render('v2-normal', {
	sitekey: process.env.GOOGLE_RECAPTCHA_KEY
});

This will works with v2 enterprise.