mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
remove console.log
This commit is contained in:
@@ -70,7 +70,7 @@ function onConnect(socket) {
|
|||||||
if (err || !userData) {
|
if (err || !userData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('event:connect');
|
socket.emit('event:connect');
|
||||||
if (userData.status !== 'offline') {
|
if (userData.status !== 'offline') {
|
||||||
socket.broadcast.emit('event:user_status_change', {uid: socket.uid, status: userData.status || 'online'});
|
socket.broadcast.emit('event:user_status_change', {uid: socket.uid, status: userData.status || 'online'});
|
||||||
@@ -164,21 +164,18 @@ function requireModules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function authorize(socket, callback) {
|
function authorize(socket, callback) {
|
||||||
var handshake = socket.request,
|
var handshake = socket.request;
|
||||||
sessionID;
|
|
||||||
|
|
||||||
if (!handshake) {
|
if (!handshake) {
|
||||||
return callback(new Error('[[error:not-authorized]]'));
|
return callback(new Error('[[error:not-authorized]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
cookieParser(handshake, {}, next);
|
cookieParser(handshake, {}, next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
var sessionID = handshake.signedCookies['express.sid'];
|
db.sessionStore.get(handshake.signedCookies['express.sid'], next);
|
||||||
console.log(next, sessionID)
|
|
||||||
db.sessionStore.get(sessionID, next);
|
|
||||||
},
|
},
|
||||||
function(sessionData, next) {
|
function(sessionData, next) {
|
||||||
if (sessionData && sessionData.passport && sessionData.passport.user) {
|
if (sessionData && sessionData.passport && sessionData.passport.user) {
|
||||||
|
|||||||
Reference in New Issue
Block a user