Private
Public Access
1
0

working user authentication w/ fb and plain login

This commit is contained in:
2016-11-04 20:57:34 +01:00
parent 88144ebaa4
commit ada68b9100
10 changed files with 175 additions and 20 deletions

View File

@@ -10,7 +10,6 @@
xfbml : true,
version : 'v2.8'
});
FB.AppEvents.logPageView();
};
(function(d, s, id){
@@ -24,16 +23,11 @@
function fb_login() {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// connected
alert('Already connected, redirect to login page to create token.');
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
} else {
// not_authorized
FB.login(function(response) {
if (response.authResponse) {
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
} else {
alert('Cancelled.');
}
}, {scope: 'email'});
}