FB.logout() called without an access token

前端 未结 6 1819
谎友^
谎友^ 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 04:06

    Should be something more like this. There was a change to the JS API where you have to use authResponse instead of just session.

    //handle a session response from any of the auth related calls
    function handleSessionResponse(response) {
    
        //if we dont have a session (which means the user has been logged out, redirect the user)
        if (!response.authResponse) {
            return;
        }
    
        //if we do have a non-null response.session, call FB.logout(),
        //the JS method will log the user out of Facebook and remove any authorization cookies
        FB.logout(response.authResponse);
    }
    

提交回复
热议问题