Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $cordovaOauth.facebook("886730451383253", ["email"]).then(function(response) {
- console.log('access token : '+response.access_token);
- $http
- .post(domain+'/api/facebook/login?access_token='+access_token.key, response.access_token)
- .then(function(response){
- console.log('Api called');
- //$ionicLoading.hide();
- if(response.error_status == false){
- $localStorage.setObject('identity_token', response.user.api_key);
- $location.path( "/" );
- }
- else{
- $scope.error = response.error;
- }
- });
- }, function(error) {
- alert(error);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement