[英]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.我在 Angular 应用程序上使用 ng-recaptcha 模块( https://www.npmjs.com/package/ng-recaptcha )来保护注册页面。 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.我一直在谷歌搜索,发现一些帖子告诉我问题可能是错误的 Google API 密钥。 I've generated a new pair from Google's panel but the error persists.
我从 Google 的面板生成了一对新的,但错误仍然存在。
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.经过一些测试,我们发现问题在于从 Google 面板生成的密钥不起作用。 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...
有时间我们会对此进行一些调查,但我们认为这与我们最近取消了此帐户的 G-Suite 订阅有关...
Well, at least now we know it has nothing to do with ng-recaptcha
module or the application itself.好吧,至少现在我们知道它与
ng-recaptcha
模块或应用程序本身无关。
Cheers!干杯!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.