📜  passport.initialize() 中间件未使用 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:40.803000             🧑  作者: Mango

代码示例1
its because you have declared the middleware after you have intialised the routes 
in the index file
the correct order is
app.use(passport.initialize());
app.use(passport.session());
app.use(passport.setAuthenticatedUser);


app.use('/', require('./routes'));