Browse Source

Fixed locals middleware doing an auth check for assets, scripts and other static content.

master 1.4.2
Gisle Aune 6 years ago
parent
commit
7c55fc03aa
  1. 2
      middleware/locals.js

2
middleware/locals.js

@ -28,6 +28,7 @@ module.exports = (req, res, next) => {
}
}
if (["/static/", "/hax/", "/assets/"].find(p => req.path.startsWith(p)) == null) {
if (req.user) {
res.locals.user = {
loggedIn: true,
@ -39,6 +40,7 @@ module.exports = (req, res, next) => {
loggedIn: false,
}
}
}
next()
}

Loading…
Cancel
Save