简体   繁体   中英

Google Recaptcha v3 with ng-recaptcha not working on production

I'm using ng-recaptcha module ( https://www.npmjs.com/package/ng-recaptcha ) on an Angular application to protect a register page. It was working perfectly fine on a preproduction machine, but when we've moved the application to the production one, the register page component throws the following error (translated from Spanish, it won't be exact as the English version):

The resource on “https://www.google.com/recaptcha/api.js?render=***GOOGLE_RECAPTCHA_WEB_KEY***&onload=ng2recaptchaloaded” 
was blocked due to a discordance of the MIME type (“text/html”) (X-Content-Type-Options: nosniff)

I've been googling around and I found some posts telling that the problem could be a wrong Google API key. I've generated a new pair from Google's panel but the error persists.

Any clue, please? Many thanks!

After some tests, we discovered that the problem was that the keys generated from the Google panel were not working. Generating a new pair from another account made the application work perfectly again. We'll investigate a little about this when we have time, but we think it has to do with the fact that we've cancelled recently the G-Suite subscription on this account...

Well, at least now we know it has nothing to do with ng-recaptcha module or the application itself.

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM