From 5482146bc4ba13940a22833dc9b7102c568dd1e5 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 27 Jan 2014 11:12:54 -0500 Subject: [PATCH] simplified a conditional --- src/webserver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webserver.js b/src/webserver.js index 323a977522..01ba2ac5c0 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -418,7 +418,7 @@ module.exports.server = server; async.each(routes.concat(loginRequired), function(route, next) { app.get('/' + route, function (req, res) { - if ((route === 'login' || route === 'register') && (req.user && req.user.uid > 0)) { + if (loginRequired.indexOf(route) !== -1 && (req.user && req.user.uid > 0)) { user.getUserField(req.user.uid, 'userslug', function (err, userslug) { res.redirect('/user/' + userslug);