mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
closes #1924
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user