From ebd4b19a6574a3841ced8aec296a8e7d6a1f68f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 24 Oct 2018 21:22:12 -0400 Subject: [PATCH] moved req.user up --- src/routes/authentication.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index da289f1436..a958bac97b 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -26,10 +26,10 @@ Auth.initialize = function (app, middleware) { Auth.setAuthVars = function (req, res, next) { var isSpider = req.isSpider(); req.loggedIn = !isSpider && !!req.user; - if (isSpider) { - req.uid = -1; - } else if (req.user) { + if (req.user) { req.uid = parseInt(req.user.uid, 10); + } else if (isSpider) { + req.uid = -1; } else { req.uid = 0; }