Protecting routes with express-jwt

To protect access to the read, update, and delete routes, the server will need to check that the requesting client is actually an authenticated and authorized user.

To check if the requesting user is signed in and has a valid JWT when a protected route is accessed, we will use the express-jwt module.

The express-jwt module is middleware that validates JSON Web Tokens. Run npm install express-jwt --save from the command line to install express-jwt.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.