v1.18.x
psychobunny 11 years ago
parent f697b5a2b8
commit 14db999684

@ -45,7 +45,11 @@ middleware.updateLastOnlineTime = function(req, res, next) {
middleware.redirectToAccountIfLoggedIn = function(req, res, next) {
if (req.user) {
user.getUserField(req.user.uid, 'userslug', function (err, userslug) {
res.redirect('/user/' + userslug);
if (res.locals.isAPI) {
return res.json(302, '/user/' + userslug);
} else {
res.redirect('/user/' + userslug);
}
});
} else {
next();

Loading…
Cancel
Save