From 0d2aa56b79498994dcfa1c303c40c0910464d867 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 2 May 2019 01:11:34 -0400 Subject: [PATCH] fix: view page as unauthorized user --- server/controllers/common.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/controllers/common.js b/server/controllers/common.js index f57f5e98..1dd2cef1 100644 --- a/server/controllers/common.js +++ b/server/controllers/common.js @@ -136,10 +136,8 @@ router.get('/*', async (req, res, next) => { const pageArgs = pageHelper.parsePath(req.path) if (!WIKI.auth.checkAccess(req.user, ['read:pages'], pageArgs)) { - if (pageArgs.path === 'home') { - _.set(res.locals, 'pageMeta.title', 'Unauthorized') - return res.render('unauthorized', { action: 'view' }) - } + _.set(res.locals, 'pageMeta.title', 'Unauthorized') + return res.render('unauthorized', { action: 'view' }) } const page = await WIKI.models.pages.getPage({