gpt4 book ai didi

javascript - Facebook 今天是否更改了 javascript sdk 身份验证中的某些内容?

转载 作者:行者123 更新时间:2023-11-28 09:54:59 25 4
gpt4 key购买 nike

Facebook 今天对 javascript sdk 身份验证进行了更改吗?我用过FB Javascript SDK Authetication written by Mahmud Ahsan ,在今天之前一切都很好。现在 FB.logout() 出现问题。尝试登录 his demo 然后单击“注销”按钮。并尝试再次按此按钮登录。它不会响应。 Firebug 说:在没有访问 token 的情况下调用 FB.logout()。也许有人知道如何将访问 token 添加到 FB.logout 方法或者..有有关此更改的文档链接?

我的身份验证:

window.fbAsyncInit = function() {
FB.init({ appId: '*************',
status: true,
cookie: true,
channelUrl: '//localhost/website/channel.html', // Channel File
xfbml: true,
oauth: true});

// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};



var button,userInfo;

function updateButton(response) {
button = document.getElementById('fb-auth');
userInfo = document.getElementById('userInfo');

if (response.authResponse){

FB.api('/me', function(info) {
login(response, info); //function will just change text on the button..
});

button.onclick = function() {
FB.logout(function(response) { //here we are, FB.logout method =\
logout(response); //function will just change text on the button..
});
};
} else {

button.innerHTML = 'Login';
button.onclick = function() {
showLoader(true);
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(info) {
login(response, info);
});
} else {
//user cancelled login or did not grant authorization

alert('you are not logged in to facebook or have not granted this app basic permissins. please log in and grand basic permissins to user this application');
}
}, {scope:'email,user_birthday,user_about_me'});
}
}
}

最佳答案

解决了!问题出在 FB.event.subscribe 上。我刚刚将 auth.statusChange 更改为另一个监听器 - auth.authResponseChange

关于javascript - Facebook 今天是否更改了 javascript sdk 身份验证中的某些内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10216123/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com