谷歌登录弹出并立即关闭

Google Sign-In Pops up and closes Immediately after

本文关键字:登录 谷歌      更新时间:2023-09-26

为了说明这一点,我指的是这个谷歌标志,因为有多个:谷歌登录你的网络应用

我的页面标题中有元标签和脚本标签:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="[ThatsWhereMyIDIs].apps.googleusercontent.com">

以及我体内登录的div元素:

<div class="g-signin2" data-onsuccess="onSignIn" onclick="console.log('yay');"></div>

我使用"yay"来检查元素是否被触发,事实确实如此,但从未调用"data onsuccess"。

这可能是什么原因,此外,我该如何解决?

感谢您的帮助。

我也有同样的问题,但只是在部署时。它在本地服务器中工作。我认为这是因为它需要https,而我正在测试的服务器没有。