title: ExpressJs JWT secret or public key must be provided
body: <p>I would like to make check-auth but return to me</p>
  <blockquote>
  <p>JsonWebTokenError: secret or public key must be provided</p>
  </blockquote>
  <p>I can take token successful</p>
  <p>how can i fix this?</p>
  <p>I am following this tutorial ;</p>
  <p><a href="https://www.youtube.com/watch?v=8Ip0pcwbWYM&amp;t=633s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=8Ip0pcwbWYM&amp;t=633s</a></p>
  <pre class="lang-js prettyprint-override"><code>const jwt = require('jsonwebtoken');
  module.exports = (req, res, next) =&gt; {
    try {
      const token = req.headers.authorization.split(&quot; &quot;)[1];
      console.log(token);
      const decoded = jwt.verify(token, process.env.JWT_KEY);
      req.userData = decoded;
      next();
    } catch (error) {
      console.log(error);
      return res.status(401).json({
        message: 'Auth failed'
      })
    }
  }
  </code></pre>