Facebook Logout - How to move the person from Facebook

3

The Login portion is OK. I had to add a "You are not x? Click here to login with another account" that calls the following function:

function deslogarFacebook(){

    FB.logout(function (response){

    window.location.href = "login";

}); }

He's sending you back to the login screen. However, it continues to appear "Continue as X" (where X is the name of the person who is logged in to Facebook) and I would like that by clicking this button it would disengage the person from Facebook also so that she could log in with another account.

I have already read the documentation from Facebook Developers but there is only 3 cases about FB.Logout but it does not explain how I can actually remove the person from Facebook so that he can log in with another account.

    
asked by anonymous 24.08.2017 / 14:21

1 answer

2

I found the solution and it was as follows. I added this code in window.fbAsyncInit:

FB.Event.subscribe("auth.logout", function(){       
    window.location = '[sua tela de login aqui]'
});

And the button quits Facebook when the person wants to sign in with another account:

<div class="fb-login-button" data-max-rows="1" data-size="large" data-button-type="continue_with" data-show-faces="false" data-auto-logout-link="true" data-use-continue-as="false"></div>
    
06.09.2017 / 19:30