mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
#2477 403 page
This commit is contained in:
@@ -12,14 +12,14 @@ helpers.notFound = function(req, res, error) {
|
||||
}
|
||||
};
|
||||
|
||||
helpers.notAllowed = function(req, res) {
|
||||
helpers.notAllowed = function(req, res, error) {
|
||||
var uid = req.user ? req.user.uid : 0;
|
||||
|
||||
if (uid) {
|
||||
if (res.locals.isAPI) {
|
||||
res.status(403).json('not-allowed');
|
||||
res.status(403).json({path: req.path.replace(/^\/api/, ''), loggedIn: !!uid, error: error});
|
||||
} else {
|
||||
res.status(403).render('403');
|
||||
res.status(403).render('403', {path: req.path, loggedIn: !!uid, error: error});
|
||||
}
|
||||
} else {
|
||||
if (res.locals.isAPI) {
|
||||
|
||||
Reference in New Issue
Block a user