var login = false;
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
console.log('connected');
login=true;
// the user is logged in and connected to your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
}
else{
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
if(login===false)
{
window.open("http://www.facebook.com/EnergyZuerich/app_332399760133904", "_top");
}
//window.location.href=window.location.href;
//FB.logout(function(response) {
//console.log('Logged out.');
//});
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'email'});
}});
此身份验证适用于我和我公司的大多数其他人,除了一个人,它会导致一个infite循环。
登录弹出窗口显示短时间内(他已经过身份验证)。然后弹出窗口消失,网站刷新并从头开始。
我使用IE,Firefox和Chrome进行了测试,没有任何问题。他正在尝试使用Firefox ..
有人可以帮我吗?
答案 0 :(得分:2)
用户可能已禁用Cookie。