Created
May 2, 2020 18:24
-
-
Save fernandocamargo/34187f1ddd4cfc83c1a50af7635be216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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