我正在尝试使用Socket.io和passport.js
进行会话存储var session = require('express-session');
var cookieParser = require('cookie-parser');
var MongoStore = require('connect-mongo')(session);
var sessionStore = session({
store: new MongoStore({url: 'mongodb://localhost/RULE'}),
key: 'express.sid',
secret: 'Heisenberg'
});
// Socket.io auth
io.set('authorization', passportSocketIo.authorize({
cookieParser: cookieParser,
key: 'express.sid',
secret: 'Heisenberg',
store: sessionStore,
success: onAuthorizeSuccess,
fail: onAuthorizeFail,
}));
我收到此错误:
TypeError: auth.store.get is not a function
所以我想这是connect-mongo
商店实例的问题,但我不知道如何调试它或问题可能是什么。