title: Do I need JWTs with Passport.js?
body: <p>I have been using Auth0 to create user accounts on my react webpage. It uses JWTs, sent to the server, to authenticate and protect the routes.</p>
  <p>I am now working on a express based app that uses Auth0 and Passport.js. The server uses a middleware function and calls the .isAuthenticated() function, checking to see if the user is logged in. My client is asking if I should 'upgrade' this system to use JWTs instead of using this middleware. Would ya'll be able to guide me? Should I try to change his website to use JWTs?</p>
  <p>Thanks!</p>
  <p>Here is the middleware function for all the routes -</p>
  <pre><code>const isLoggedIn = (request, response, next) =&gt; {
  // if user is authenticated in the session, carry on
  if (request.isAuthenticated())
      return next();
  // if they aren't, redirect them to the home page
  response.redirect('/login');
  };
  </code></pre>
  <p>I found the method in the passport files - Now I guess I need to figure out what _passport is in order to see if its secure.</p>
  <pre><code>/**
  * Test if request is authenticated.
  *
  * @return {Boolean}
  * @api public
  */
    req.isAuthenticated = function() {
      var property = 'user';
      if (this._passport &amp;&amp; this._passport.instance) {
        property = this._passport.instance._userProperty || 'user';
      }
  
   return (this[property]) ? true : false;
  </code></pre>
  <p>};</p>