fix: redirect home to login only if guest
This commit is contained in:
parent
7d23344c7a
commit
1fc786e2ed
@ -245,7 +245,7 @@ router.get('/*', async (req, res, next) => {
|
|||||||
pageArgs.tags = _.get(page, 'tags', [])
|
pageArgs.tags = _.get(page, 'tags', [])
|
||||||
|
|
||||||
if (!WIKI.auth.checkAccess(req.user, ['read:pages'], pageArgs)) {
|
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')
|
return res.redirect('/login')
|
||||||
}
|
}
|
||||||
_.set(res.locals, 'pageMeta.title', 'Unauthorized')
|
_.set(res.locals, 'pageMeta.title', 'Unauthorized')
|
||||||
|
Loading…
Reference in New Issue
Block a user