v1.18.x
Julian Lam 10 years ago
parent 7efc0619cc
commit 22a619d9c7

@ -69,7 +69,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 = nconf.get('relative_path') + req.url;
req.session.returnTo = nconf.get('relative_path') + req.url.replace(/^\/api/, '');
return res.redirect(nconf.get('relative_path') + '/login');
} else {
next();

Loading…
Cancel
Save