Commit 1fc786e2 authored by NGPixel's avatar NGPixel

fix: redirect home to login only if guest

parent 7d23344c
......@@ -245,7 +245,7 @@ router.get('/*', async (req, res, next) => {
pageArgs.tags = _.get(page, 'tags', [])
if (!WIKI.auth.checkAccess(req.user, ['read:pages'], pageArgs)) {
if (pageArgs.path === 'home') {
if (pageArgs.path === 'home' && req.user.id === 2) {
return res.redirect('/login')
}
_.set(res.locals, 'pageMeta.title', 'Unauthorized')
......
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