Skip to content

Instantly share code, notes, and snippets.

@fernandocamargo
Created May 2, 2020 18:24
Show Gist options
  • Save fernandocamargo/34187f1ddd4cfc83c1a50af7635be216 to your computer and use it in GitHub Desktop.
Save fernandocamargo/34187f1ddd4cfc83c1a50af7635be216 to your computer and use it in GitHub Desktop.
export default (authenticate, deny) => {
// from https://developers.facebook.com/docs/reference/javascript/FB.login/v6.0
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
// actual integration
authenticate(response);
});
} else {
console.log('User cancelled login or did not fully authorize.');
deny();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment