Browse Source

Always redirect to login provider when autoLogin is set

pull/6335/head
Paul O'Fallon 2 years ago
parent
commit
22c57424af
1 changed files with 3 additions and 0 deletions
  1. 3
      server/controllers/common.js

3
server/controllers/common.js

@ -450,6 +450,9 @@ router.get('/*', async (req, res, next) => {
if (pageArgs.path === 'home' && req.user.id === 2) { if (pageArgs.path === 'home' && req.user.id === 2) {
return res.redirect('/login') return res.redirect('/login')
} }
if (WIKI.config.auth.autoLogin && req.user.id === 2) {
return res.redirect('/login')
}
_.set(res.locals, 'pageMeta.title', 'Unauthorized') _.set(res.locals, 'pageMeta.title', 'Unauthorized')
return res.status(403).render('unauthorized', { return res.status(403).render('unauthorized', {
action: 'view' action: 'view'

Loading…
Cancel
Save