Facebook Logout - How to Deploy the Facebook Person

Asked

Viewed 591 times

3

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

function deslogarFacebook(){

    FB.logout(function (response){

    window.location.href = "login";

}); }

He’s sending it back to the login screen. However, it still appears "Continue as X" (where X is the name of the person who is logged in to Facebook) and I would like to click on this button he would also uncheck the person from Facebook so that he could log in with another account.

I’ve read the documentation of Facebook Developers but it just says that there are 3 cases regarding FB.Logout but it does not explain how I really dislocate the person from Facebook so that they can log in with another account.

1 answer

2

I found the solution, and this is it. I added this code to the.fbAsyncInit window:

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

And the Quit Facebook button when the person wants to log 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.