|
|
|
@ -164,8 +164,7 @@ function requireModules() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function authorize(socket, callback) {
|
|
|
|
|
var handshake = socket.request,
|
|
|
|
|
sessionID;
|
|
|
|
|
var handshake = socket.request;
|
|
|
|
|
|
|
|
|
|
if (!handshake) {
|
|
|
|
|
return callback(new Error('[[error:not-authorized]]'));
|
|
|
|
@ -176,9 +175,7 @@ function authorize(socket, callback) {
|
|
|
|
|
cookieParser(handshake, {}, next);
|
|
|
|
|
},
|
|
|
|
|
function(next) {
|
|
|
|
|
var sessionID = handshake.signedCookies['express.sid'];
|
|
|
|
|
console.log(next, sessionID)
|
|
|
|
|
db.sessionStore.get(sessionID, next);
|
|
|
|
|
db.sessionStore.get(handshake.signedCookies['express.sid'], next);
|
|
|
|
|
},
|
|
|
|
|
function(sessionData, next) {
|
|
|
|
|
if (sessionData && sessionData.passport && sessionData.passport.user) {
|
|
|
|
|