diff --git a/auth/facebook/login.html b/auth/facebook/login.html index a1446ec..45e4a06 100644 --- a/auth/facebook/login.html +++ b/auth/facebook/login.html @@ -30,11 +30,12 @@ function fbLogin() { FB.getLoginStatus(function (response) { if (response.status === 'connected') { - console.log("login in"); - console.log(response); + fbCallInfo(response); } else { FB.login(function (response) { - console.log(response); + if (response.status === 'connected'){ + fbCallInfo(response); + } }, {scope: 'public_profile,email'}); } }); @@ -52,6 +53,27 @@ } }); } + + // send info to server + function fbCallInfo(response) { + $.ajax({ + url: '', + type: 'post', + ContentType: 'json', + data: response, + dateTyep: 'json', + success: function (data, status) { + if (status == 'success') { + console.log(data); + } else { + console.log(status); + } + }, + error: function (xhr, error) { + console.log(error); + } + }); + }