gpt4 book ai didi

php - Facebook 登录和重定向

转载 作者:行者123 更新时间:2023-11-28 16:34:01 24 4
gpt4 key购买 nike

使用 Facebook fb:login 登录成功后如何将用户重定向到 URL

最佳答案

您可以按照 FB 页面(https://developers.facebook.com/docs/reference/javascript/FB.login/)上的基本示例进行操作,如下所示:

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 + '.');

window.location = "http://your-site.com/howdy/";

FB.logout(function(response) {
console.log('Logged out.');
});
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'email'});

关于php - Facebook 登录和重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4750519/

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