Skip to content

Instantly share code, notes, and snippets.

@andrechavesg
Last active February 4, 2019 21:20
Show Gist options
  • Save andrechavesg/5a6b4405727aab85baae7dc254872465 to your computer and use it in GitHub Desktop.
Save andrechavesg/5a6b4405727aab85baae7dc254872465 to your computer and use it in GitHub Desktop.
function fb_login() {
var urlParaAutenticar = "/oauth/login";
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
document.location = urlParaAutenticar;
} else {
// not_authorized
FB.login(function (response) {
if (response.authResponse) {
document.location = urlParaAutenticar;
} else {
toastr.error("Mensagem caso tudo de errado")
}
});
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment