title: error using express-jwt: jwt is not a function
body: <p>I'm using express-jwt in my project but I'm getting this error, I couldn't find the solution</p>
  <pre><code> import jwt from &quot;express-jwt&quot;;
      const getTokenFromHeaders = (req) =&gt; {
          const { headers: { authorization } } = req
      
          if (authorization &amp;&amp; authorization.spilt(' ')[0] === 'Token') {
              return authorization.split(' ')[1]
          }
          return null
      }
      
      const auth = {
          required: jwt({
              secret: &quot; /\-l/\Y&quot;,
              userProperty: 'payload',
              getToken: getTokenFromHeaders
          }),
          optional: jwt({
              secret: &quot;/\-l/\Y&quot;,
              userProperty: 'payload',
              getToken: getTokenFromHeaders,
              credentialsRequired: false,
          })
      }
      
      export default auth
  </code></pre>
  <p>this use</p>
  <pre><code>router.post(&quot;/login&quot;, auth.optinal, (req, res, next) =&gt; {
        const { body: { user } } = req
      
        if (!user.email &amp;&amp; !user.password) {
          return res.status(402).json({
            errors: &quot;Eposta veya şifre yanlış ! &quot;,
          });
      
          return passport.authenticate('local', { session: false }, (err, passportUser, info) 
   =&gt; {
            if (err) {
              return next(err)
            }
            if (passportUser) {
              const user = passportUser
              user.token = passportUser.genareteJWT();
              return res.json({ user: user.toAuthJSON() })
            }
            return res.status(400).info;
      
          })(req, res, next)
        }
      })
  </code></pre>
  <p>and error message:</p>
  <blockquote>
  <p>required: jwt({<br>
  ^<br>
  TypeError: jwt is not a function<br>
  at file:///C:/Users/atala/Desktop/atalayapp-main/backend/middleware/auth/auth.js:12:15<br>
  at ModuleJob.run (node:internal/modules/esm/module_job:198:25)<br>
  at async Promise.all (index 0)<br>
  at async ESMLoader.import (node:internal/modules<br>/esm/loader:385:24)<br>
  at async loadESM (node:internal/process/esm_loader:88:5)<br>
  at async handleMainPromise (node:internal/modules/run_main:61:12)<br></p>
  </blockquote>