What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-11 00:28:14
ejs jwt authentication
const cookieParser = require('cookie-parser') const withAuthUserId = [ cookieParser(), (req, res, next) => { const claims = jsonwebtoken.verify(req.cookies['jwt'], jwtKey) req['authUserId'] = claims['sub'] next() } ] app.get('/api/a... Add solution