我正在尝试这里描述的解决方法
https://github.com/jaredhanson/passport/issues/14
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
工作正常
app.use(app.router);
app.use(express.static(__dirname + '/public'));
app.use(passport.initialize());
app.use(passport.session());
给
DEBUG: Error: passport.initialize() middleware not in use
at IncomingMessage.<anonymous> (/.../node_modules/passport/lib/passport/http/request.js:30:30)
at Context.<anonymous> (/.../node_modules/passport/lib/passport/middleware/authenticate.js:92:11)
at Context.<anonymous> (/.../core/node_modules/passport/lib/passport/context/http/actions.js:21:25)
at Strategy.success (native)