This commit is contained in:
barisusakli
2014-07-30 15:14:04 -04:00
parent 7e82d3d9a5
commit cfc67d4e90
8 changed files with 24 additions and 33 deletions

View File

@@ -161,11 +161,7 @@ middleware.checkAccountPermissions = function(req, res, next) {
}
if (!uid) {
if (res.locals.isAPI) {
return res.json(404, 'not-found');
} else {
return res.redirect('404');
}
return res.locals.isAPI ? res.json(404, 'not-found') : res.redirect(nconf.get('relative_path') + '/404');
}
if (parseInt(uid, 10) === callerUID) {
@@ -181,11 +177,7 @@ middleware.checkAccountPermissions = function(req, res, next) {
return next();
}
if (res.locals.isAPI) {
return res.json(403, 'not-allowed');
} else {
return res.redirect('403');
}
res.locals.isAPI ? res.json(403, 'not-allowed') : res.redirect(nconf.get('relative_path') + '/403');
});
});
};