Merge remote-tracking branch 'origin/master' into 0.7.0

v1.18.x
barisusakli 10 years ago
commit f8a03c4fca

@ -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