|
|
@ -36,9 +36,17 @@ helpers.notFound = function(req, res, error) {
|
|
|
|
helpers.notAllowed = function(req, res, error) {
|
|
|
|
helpers.notAllowed = function(req, res, error) {
|
|
|
|
if (req.uid) {
|
|
|
|
if (req.uid) {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
res.status(403).json({path: req.path.replace(/^\/api/, ''), loggedIn: !!req.uid, error: error});
|
|
|
|
res.status(403).json({
|
|
|
|
|
|
|
|
path: req.path.replace(/^\/api/, ''),
|
|
|
|
|
|
|
|
loggedIn: !!req.uid, error: error,
|
|
|
|
|
|
|
|
title: '[[global:403.title]]'
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
res.status(403).render('403', {path: req.path, loggedIn: !!req.uid, error: error});
|
|
|
|
res.status(403).render('403', {
|
|
|
|
|
|
|
|
path: req.path,
|
|
|
|
|
|
|
|
loggedIn: !!req.uid, error: error,
|
|
|
|
|
|
|
|
title: '[[global:403.title]]'
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|