title: How to make passport session isAuthenticated() working with Angular ng-view?
body: <p>ok, if you use session, for each route you can check to see if this page is authenticated or not. If not, usually redirect to login page. e.g.</p>
  
  <pre><code>function isAuthenticated(req, res, next) {
  
      // do any checks you want to in here
  
      // CHECK THE USER STORED IN SESSION FOR A CUSTOM VARIABLE
      // you can do this however you want with whatever variables you set up
      if (req.user.authenticated)
          return next();
  
      // IF A USER ISN'T LOGGED IN, THEN REDIRECT THEM SOMEWHERE
      res.redirect('/');
  }
  module.exports = function(app) {
  
      app.get('/hello', isAuthenticated, function(req, res) {
          res.send('look at me!');
      });
  
  };
  </code></pre>
  
  <p>Now the problem is, in the front end i'm using angular.js, the left side of the page is menu buttons, the right side is the ng-view area.
  res.redirect('/') is not working for me, it still displays the page just as if it's logged in, has left side menus, except no valid contents in the ng-view area.</p>
  
  <p>Anyone has example to make res.redirect to work with angular.js ?</p>
  
  <p>Thanks ! </p>