commenting out global.uid setting

v1.18.x
Julian Lam 12 years ago
parent 9e5a7b96b3
commit 3eb4f0e1a2

@ -14,7 +14,7 @@ global.configuration = {};
global.modules = modules;
// change this to = null when auth module is complete
global.uid = 1;
// global.uid = 1;

@ -21,13 +21,7 @@ var config = require('../config.js'),
return global.socket.emit('user.login', {'status': 0, 'message': 'Incorrect username / password combination.'});
} else {
// Start, replace, or extend a session
RDB.get('session:' + user.sessionID, function(session) {
if (session !== user.sessionID) {
RDB.set('session:' + user.sessionID, uid, 60*60*24*14); // Login valid for two weeks
} else {
RDB.expire('session:' + user.sessionID, 60*60*24*14); // Defer expiration to two weeks from now
}
});
global.uid = uid;
return global.socket.emit('user.login', {'status': 1, 'message': 'Logged in!'});
}

@ -24,7 +24,7 @@ var express = require('express'),
// Include this middleware if the endpoint requires a logged in user to view
console.log('REQUIRE: ', global.uid, req.sessionID);
if (!global.uid) {
req.redirect('/403');
res.redirect('/403');
} else {
next();
}

Loading…
Cancel
Save