0
votes

I was trying to implement facebook integration, I got this error:

XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%3A%2F%2Fchefin.com%2Fauth%2Ffacebook%2Fcallback&client_id=865410220269534. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://chefin.com' is therefore not allowed access.

when I call auth/facebook URL on button click.

$scope.facebookLogin = function() {

        $http({
            url: '/auth/facebook',
            method: 'GET',
        }).success(function(response) {
        });
    };
1

1 Answers

0
votes

It seems the /auth/facebook is having a redirect request. So instead of AJAX can you try:

$scope.facebookLogin = function() {
    window.location.href = "/auth/facebook";
}