Commit 13358b26 authored by Nick's avatar Nick

fix: auto redirect to login from homepage

parent 93237cda
......@@ -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' })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment