0 points

Generalize user information in nodejs


dashboard

Mon Aug 17 2020 16:22:15 GMT+0000 (UTC)

Posted by @brainyworld #nodejs #javascript

// Let generalize user data
app.use((req, res, next) => {
    res.locals.user = req.isAuthenticated() ? req.user : null
    return next()
})
content_copy Copy