passport.js session lost after redirect
问题 I am trying to integrate passport into my node.js app. app.js file const app = express(); app.set('view engine', 'pug'); app.use('/libs', express.static('node_modules')); require('../config/auth.config')(app, data, passport); app.use((req, res, next) => { res.locals.user = req.user; next(); }); app.get('/', (req, res) => { // those objects are populated correctly after redirect from auth middleware console.log(req.session) console.log(req.user) return res.render('home'); }); app.get('/login',