From 3eb4f0e1a2e81006494e25d995a3181171196585 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 25 Apr 2013 00:05:17 -0400 Subject: [PATCH] commenting out global.uid setting --- app.js | 2 +- src/user.js | 8 +------- src/webserver.js | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 1a5e97b762..8ab74cf957 100644 --- a/app.js +++ b/app.js @@ -14,7 +14,7 @@ global.configuration = {}; global.modules = modules; // change this to = null when auth module is complete -global.uid = 1; +// global.uid = 1; diff --git a/src/user.js b/src/user.js index 95ee11cf59..2fb6437a70 100644 --- a/src/user.js +++ b/src/user.js @@ -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!'}); } diff --git a/src/webserver.js b/src/webserver.js index de3385a873..5aa5b2cbee 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -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(); }