From 03de918f109acd6720f705916f87bf858d6ebb43 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 12 Dec 2014 16:20:24 -0500 Subject: [PATCH] fix more relative path redirects --- src/middleware/middleware.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index fa0a9c5715..5e27bfa6bf 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -60,9 +60,9 @@ middleware.redirectToAccountIfLoggedIn = function(req, res, next) { } if (res.locals.isAPI) { - res.status(302).json('/user/' + userslug); + res.status(302).json(nconf.get('relative_path') + '/user/' + userslug); } else { - res.redirect('/user/' + userslug); + res.redirect(nconf.get('relative_path') + '/user/' + userslug); } }); }; @@ -70,7 +70,7 @@ middleware.redirectToAccountIfLoggedIn = function(req, res, next) { middleware.redirectToLoginIfGuest = function(req, res, next) { if (!req.user || parseInt(req.user.uid, 10) === 0) { req.session.returnTo = req.url; - return res.redirect('/login'); + return res.redirect(nconf.get('relative_path') + '/login'); } else { next(); }