Last active
February 4, 2019 21:20
-
-
Save andrechavesg/5a6b4405727aab85baae7dc254872465 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
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