Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Your express-jwt logic works for me. Are you sending a valid JWT within the Authorization header in Postman? Commented Feb 1, 2017 at 11:09
  • @dan I want to check the unautorizedError and catched that in app.js something like app.use(function (err, req, res, next) { if (err.name === 'UnauthorizedErorr') { res.status(401); res.json("message : " + err.name + " : " + err.message); } }); and expect a message response. Commented Feb 1, 2017 at 11:13
  • @dan Sorry, checked again i have a type mistake in app.js (UnauthorizedErorr ). Thank u Commented Feb 1, 2017 at 11:15
  • Ok, I've posted an answer to show an example of that. Hopefully that helps. Commented Feb 1, 2017 at 11:52