From ef4a94857d1a1a601c5c666d7e88749bdb2ba647 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 18 May 2016 11:05:25 -0400 Subject: [PATCH] fixed admin lockout timer for subfolder installs @barisusakli :trollface: --- src/middleware/middleware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 342ecdc38f..9267289d3f 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -209,12 +209,12 @@ middleware.isAdmin = function(req, res, next) { return next(); } - req.session.returnTo = nconf.get('relative_path') + req.path.replace(/^\/api/, ''); + req.session.returnTo = req.path.replace(/^\/api/, ''); req.session.forceLogin = 1; if (res.locals.isAPI) { res.status(401).json({}); } else { - res.redirect('/login'); + res.redirect(nconf.get('relative_path') + '/login'); } }); return;