Middleware to authenticate and verify JSON Web Token (JWT).
- Source:
Example
// Route that requires authentication
app.get('/protected', auth, (req, res) => {
res.send('Protected content');
});
Requires
- module:jsonwebtoken
- module:config