2011-01-21 57 views
0

我已经把我的网站Facebook登录按钮。现在他们登录并授予权限后,我喜欢将它们转发到登录后页面。facebook登录按钮集成 - 用户没有得到转发

问题是,他们登录后,它不会被转发到登录后的页面。

FB.login(function(response) { 
    if (response.session) { 
    if (response.perms) { 
    window.location = "http://www.mysite.com/postlogin.aspx"; 
    // user is logged in and granted some permissions. 
    // perms is a comma separated list of granted permissions 
    } else { 
    // user is logged in, but did not grant any permissions 
    } 
    } else { 
    // user is not logged in 
    } 
    }, {perms:'read_stream,publish_stream,offline_access'}); 

感谢 贝洛兹

回答

0

你确定你要成内if语句(如果(response.perms))?

0

我相信if(response.perms)是不必要的。尝试删除它。另一种方法是添加此行:FB.Event.subscribe('auth.login', function() { window.location = "http://www.mysite.com/postlogin.aspx"; });

这会将您的页面订阅到auth.login事件,并且应在登录完成后转发用户。