recaptcha-module icon indicating copy to clipboard operation
recaptcha-module copied to clipboard

Unable to load script with V2 Enterprise

Open afiqiqmal opened this issue 2 years ago • 2 comments

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

afiqiqmal avatar Jul 07 '22 16:07 afiqiqmal

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

Hello, what's the error?

mvrlin avatar Jul 07 '22 19:07 mvrlin

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.

afiqiqmal avatar Jul 08 '22 01:07 afiqiqmal