|
@ -28,15 +28,17 @@ module.exports = (req, res, next) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (req.user) { |
|
|
|
|
|
res.locals.user = { |
|
|
|
|
|
loggedIn: true, |
|
|
|
|
|
name: req.user._json.name, |
|
|
|
|
|
permissions: getPermissions(req.user._json.name), |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
res.locals.user = { |
|
|
|
|
|
loggedIn: false, |
|
|
|
|
|
|
|
|
if (["/static/", "/hax/", "/assets/"].find(p => req.path.startsWith(p)) == null) { |
|
|
|
|
|
if (req.user) { |
|
|
|
|
|
res.locals.user = { |
|
|
|
|
|
loggedIn: true, |
|
|
|
|
|
name: req.user._json.name, |
|
|
|
|
|
permissions: getPermissions(req.user._json.name), |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
res.locals.user = { |
|
|
|
|
|
loggedIn: false, |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|