根据谷歌文档: 当加载谷歌登录按钮时,它会立即检查用户是否已授权该应用程序。此检查称为“立即模式”,如果成功,Google 服务器将返回访问 token 并将新的授权结果对象传递给回调。如果该按钮无法进行即时授权,则用户必须点击登录按钮才能触发访问流程。
My Google Plus signin button is part of header and on logout the home page is loaded,It again renders google plus button resulting in automatic login. User is never logged out due to this. How is it possible to allow login when when G Plus button is clicked and not when when the G Plus buttom reders itself?
最佳答案
“immediate”参数为我做到了这一点,尽管它与“approvalprompt”具有相同的效果,提示同意。 Facebook 似乎在处理这些选项方面做得更好一些。
gapi.signin.render("splashGPlusReg", {
'callback': GPSignInCallback,
'clientid': '<yourclientId>',
'cookiepolicy': 'single_host_origin',
'immediate': false,
'requestvisibleactions': 'http://schemas.google.com/AddActivity',
'scope': '<scopes>'
});
关于google-plus-one - 如何使用 Gplus 按钮渲染/删除立即 Google Plus 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17259585/