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

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

问题描述

我在使用 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.

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

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