Browse Source

fix: redirect home to login only if guest

pull/1452/head
NGPixel 4 years ago
parent
commit
1fc786e2ed
1 changed files with 1 additions and 1 deletions
  1. 2
      server/controllers/common.js

2
server/controllers/common.js

@ -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')

Loading…
Cancel
Save