title: difference between using jwt
body: <p>Question 1: What's the difference between the first approach and the second one</p>
  <p>Question 2: what are the use case for both of them?</p>
  <p>jwtMW:</p>
  <pre><code>const jwtMW = exjwt({
    secret: &quot;keyboard cat 4 ever&quot;,
    algorithms: [&quot;HS256&quot;],
    credentialsRequired: true,
  });
  </code></pre>
  <p>approach one</p>
  <pre><code>router.post(&quot;/authRequest&quot;, jwtMW, async (req, res) =&gt; {
    let toeken = req.headers.authorization;
    // use the decoded infomation for further verification
  });
  </code></pre>
  <p>approach two</p>
  <pre><code>router.post(&quot;/authRequest2&quot;, async (req, res) =&gt; {
    const reqToken = req.headers.authorization.split(&quot; &quot;)[1];
    const secret = &quot;keyboard cat 4 ever&quot;;
    var decoded = jwt.verify(reqToken, secret);
    // use the decoded infomation for further verification
  });
  </code></pre>
  <p>Thanks in advance.</p>