title: Special Passport Authentication for Specific Route
body: <p>I'm developing a RESTful API with Express.js and I'm using Passport.js for authentication purposes.<br>
  Here is an example of how I'm using passport with routes:</p>
  
  <pre><code>const beerRoutes = require('./beerRoutes')     // an instance of express router
  let authenticateRoute = passport.authenticate('jwt', { session: false })
  
  router.use('/beer', authenticateRoute, beerRoutes)
  </code></pre>
  
  <p>Inside beerRoutes.js :  </p>
  
  <pre><code>const router = require('express').Router()
  
  router.post('/', (req, res) =&gt; {})
  router.get('/', (req, res) =&gt; {})
  router.patch('/', (req, res) =&gt; {})
  router.delete('/', (req, res) =&gt; {})
  </code></pre>
  
  <p>The problem is, I want unauthenticated clients to be able to create new users (i.e. <code>POST /beer/</code>).
  But I also want to give additional permissions to authenticated clients when they send a request to the same endpoint.</p>
  
  <p>How can I achieve this without letting unauthenticated clients to access other routes inside <code>beerRoutes</code> (e.g. <code>PATCH /beer/</code>)?</p>