This commit is contained in:
psychobunny
2014-10-04 18:47:56 -04:00
parent bf852d8329
commit 1b2ccda40b
11 changed files with 35 additions and 35 deletions

View File

@@ -227,17 +227,17 @@ categoriesController.get = function(req, res, next) {
};
categoriesController.notFound = function(req, res) {
res.locals.isAPI ? res.json(404, 'not-found') : res.status(404).render('404');
res.locals.isAPI ? res.status(404).json('not-found') : res.status(404).render('404');
};
categoriesController.notAllowed = function(req, res) {
var uid = req.user ? req.user.uid : 0;
if (uid) {
res.locals.isAPI ? res.json(403, 'not-allowed') : res.status(403).render('403');
res.locals.isAPI ? res.status(403).json('not-allowed') : res.status(403).render('403');
} else {
if (res.locals.isAPI) {
req.session.returnTo = apiToRegular(req.url);
res.json(401, 'not-authorized');
res.status(401).json('not-authorized');
} else {
req.session.returnTo = req.url;
res.redirect(nconf.get('relative_path') + '/login');