title: expressjs conditional redirect
body: <p>I'm trying to write middleware for authentication. And I want this if statement to redirect the user to <code>'/'</code> if they're <b>not</b> logged in. If they're logged in, I wan't to redirect them to '/news'.</p>
  
  <pre><code>/*Simplified for this example*/
  
  if(rs.authenticated === true) {
      next();
  } else {
      res.redirect('/');
  }
  </code></pre>
  
  <p>Is there a way to do this inside of these if statements? Or do I have to write a new method? I've tried several ways with if statements but I just get redirect loops.</p>