title: Node express API not responding well to Angular $http calls
body: <p>What's happening is that I can't get succesfully loged in into the Node API when hitting the login route from the website via Angular $http.post() request, But it does Works pretty well when testing from postman (rest api test application).</p>
  
  <p>Here is the client side code (api calls):</p>
  
  <pre><code> function($http, $scope) {
        $scope.$watch('search', function() {
          fetch();
        });
        $scope.username = 'xxxxxxxxxxxx';
        $scope.password = 'xxxxxxxxxxxxxxxx';        
        function fetch() {
          $scope.details="";
          $http.post("http://apiadress.demo/auth/login?username=" + $scope.username + "&amp;password=" + $scope.password)
            .then(function(response) {
              $scope.details = response.data.state;
            console.log(response);
            });
        }   
      }
  </code></pre>
  
  <p>this call produces the response:</p>
  
  <pre><code>{
    "state": "fail",
    "user": null
  }
  </code></pre>
  
  <p>When making the same call from postma client responses the espected:</p>
  
  <pre><code>{
        "state": "success",
        "user": {
          "_id": "xxxxxxxxxxxxxxxxxxxx",
          "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "username": "xxxxxxxxxx",
          "__v": 0,
          "created_at": "2016-12-21T21:57:32.663Z"
        }
      }
  </code></pre>
  
  <p>My server side routing code is:</p>
  
  <pre><code>//log in
  router.post('/login', passport.authenticate('login', {
      successRedirect: '/auth/success',
      failureRedirect: '/auth/failure'
  }));
  
  //responses whit successful login state
  router.get('/success', function(req, res){
      res.send({state: req.user ? 'success' : 'fail', user: req.user ?req.user : null});
  });
  </code></pre>
  
  <p>As you can see the user seems to be authenticeted but no data is being passed on the redirection when the api is called from angular... O.o</p>