From 13358b26b077fe66368b6483b683dbdc53930705 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 26 Aug 2019 23:06:58 -0400 Subject: [PATCH] fix: auto redirect to login from homepage --- server/controllers/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/controllers/common.js b/server/controllers/common.js index 998b79e8..62cc8a98 100644 --- a/server/controllers/common.js +++ b/server/controllers/common.js @@ -181,6 +181,9 @@ router.get('/*', async (req, res, next) => { req.i18n.changeLanguage(pageArgs.locale) if (!WIKI.auth.checkAccess(req.user, ['read:pages'], pageArgs)) { + if (pageArgs.path === 'home') { + return res.redirect('/login') + } _.set(res.locals, 'pageMeta.title', 'Unauthorized') return res.status(403).render('unauthorized', { action: 'view' }) }