"immediate_failed" -无法自动登录用户 [英] "immediate_failed" - Could not automatially log in the user

查看:57
本文介绍了"immediate_failed" -无法自动登录用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google+登录开发网站时遇到问题: 我确实按照文档告诉我的步骤进行了操作,但是在步骤4中我总是失败了: https://developers.google.com/+/web/signin/

I have a problem when I developed my website with Google+ sign-in: I did step by step that the doc told me but I always failed at step4: https://developers.google.com/+/web/signin/

结果始终是"immediate_failed"-无法自动登录用户,我只是不知道为什么,有人可以帮助我,非常感谢! :-(

the result was always ""immediate_failed" - Could not automatially log in the user", I just don't kown why, can anyone help me, thanks very much! :-(

推荐答案

请注意,在您所指向的示例代码中,"immediate_failed"检查已被注释掉.这是有意的,因为用户第一次遇到页面上的登录"按钮,它将失败.

Note that in the sample code you pointed to, the "immediate_failed" check is commented out. This is intentional, since the first time a user encounters the Sign-in button on the page, it will fail.

失败的原因是,在首次加载页面时,甚至在用户没有按下按钮之前,都会向Google发送请求,以确定用户是否已经登录(例如,通过Google或其他网站).如果是,则无需再次登录,因此无需显示该按钮.但是,如果尚未尚未登录,则将收到"immediate_failed"响应,并且需要显示(或不清除)按钮.

The reason it fails is that when the page first loads, before the user even presses the button, a request is sent to Google to determine if the user has already logged in (via Google or another site, for example). If they are - there is no need for them to log in again, so the button never needs to be shown. But if they have not been logged in already, you will get the "immediate_failed" response, and will need to either show (or not clear) the button.

tl; dr-不用担心页面首次加载时会立即失败.这是正常的.

tl;dr - Don't worry aout getting immediate_failed when the page first loads. This is normal.

这篇关于"immediate_failed" -无法自动登录用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆