FB.logout() called without an access token

前端 未结 6 1812
谎友^
谎友^ 2020-11-29 03:10

I\'m trying to log out of a website i\'ve created with Facebook integrated. Logging in works fine, but when I want to log out Firebug consistently gives me this error:

6条回答
  •  暖寄归人
    2020-11-29 03:51

    I've tried something like this:

    function fbLogout(){
        if(typeof FB.logout == 'function'){
            if (FB.getAuthResponse()) {
             FB.logout(function(response) { window.location.href = PROJECT_PATH + '/index/logout'; }); 
             return;
            }  
        };
    
        window.location.href = PROJECT_PATH + '/index/logout'; 
        return;  
    }
    

提交回复
热议问题