Revert "fixes #5894"

This reverts commit e2b40ddf34.
v1.18.x
Julian Lam 8 years ago
parent 9d2bf4746c
commit 73d4517d27

@ -28,11 +28,9 @@ app.isConnected = false;
setTimeout(socket.connect.bind(socket), parseInt(config.reconnectionDelay, 10) * 10);
});
socket.on('checkSession', function (uid, remoteExist) {
if (parseInt(uid, 10) !== parseInt(app.user.uid, 10) && remoteExist) {
socket.on('checkSession', function (uid) {
if (parseInt(uid, 10) !== parseInt(app.user.uid, 10)) {
app.handleInvalidSession();
} else {
app.logout();
}
});

@ -75,20 +75,15 @@ function onConnection(socket) {
}
function onConnect(socket) {
user.exists(socket.uid, function (err, exists) {
if (err) {
return winston.error(err);
}
if (socket.uid && exists) {
socket.join('uid_' + socket.uid);
socket.join('online_users');
} else {
socket.join('online_guests');
}
if (socket.uid) {
socket.join('uid_' + socket.uid);
socket.join('online_users');
} else {
socket.join('online_guests');
}
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
io.sockets.sockets[socket.id].emit('checkSession', socket.uid, exists);
});
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
io.sockets.sockets[socket.id].emit('checkSession', socket.uid);
}
function onMessage(socket, payload) {

Loading…
Cancel
Save