mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user