Skip to content

Instantly share code, notes, and snippets.

@danasilver
Created July 16, 2013 01:02
Show Gist options
  • Save danasilver/6004934 to your computer and use it in GitHub Desktop.
Save danasilver/6004934 to your computer and use it in GitHub Desktop.
Log user out of a Facebook app without logging out of facebook.com

Calling FB.logout() is effective, but it will also log the user out of facebook entirely, prompting him or her to enter an email and password to get back into your app.

Call FB.api({ method: 'Auth.revokeAuthorization' }); instead, which just revokes the Facebook auth token for your app. When the user goes to log in again, he or she will just have to click the "Okay" button to authorize your app again. This will, of course remove the app from the users list of apps on Facebook, but they chose to revoke access in the first place, so this is expected and (hopefully) welcome behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment