jfromaniello / passport.socketio

access passport.js authenticated user information from socket.io connection
655 stars 81 forks source link

Type of "done" gets modified, passport crashes. #130

Open LaKing opened 7 years ago

LaKing commented 7 years ago

As soon as I enable passport.socketio, ...

node_modules/passport/lib/passport/index.js:321
if (err || user) { return done(err, user); }
^

TypeError: done is not a function

As far as I see at some point, done changes from a function to the request object.

This is the code I use.

var passportSocketIo = require("passport.socketio");
io.use(passportSocketIo.authorize({
    cookieParser: cookieParser, // the same middleware you registrer in express
    key: 'connect.sid', // the name of the cookie where express/connect stores its session_id
    secret: 'why-is-done-not-a-function', // the session_secret to parse the cookie
    store: mongoStore, // we NEED to use a sessionstore. no memorystore please
    //success: onAuthorizeSuccess, // *optional* callback on success - read more below
    //fail: onAuthorizeFail, // *optional* callback on fail/error - read more below
}));

Anyone any ideas?