Facebook身份验证仅适用于页面刷新,而不适用于链接传输

时间:2014-09-30 17:36:57

标签: javascript facebook facebook-graph-api

我正在使用facebook登录,并且有一种非常奇怪的行为。当我通过链接转移到页面时,它不会获取数据,但如果我刷新页面,那么它可以工作。如果我直接输入网址也可以。连接的代码:

 FB.getLoginStatus(function(response) {
                if (response.status === 'connected') {
                     var uid = response.authResponse.userID;
                    var accessToken = response.authResponse.accessToken;
                    email = response.userInfo.email;
                      f_uid = uid;
                    facebook_photo();                       
                    // the user is logged in and has authenticated 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

                    //window.location = "http://webs.hogent.be/~096506gd/home.html";
                } else if (response.status === 'not_authorized') {
                              //              alert(response.userInfo.email);
                    // the user is logged in to Facebook, 
                    // but has not authenticated your app
                } else {
                    // the user isn't logged in to Facebook.
                }
            }, {scope: 'email'});

        };

有什么想法吗?

0 个答案:

没有答案