new(all): Web log.

This commit is contained in:
Rodrigo Rodriguez 2022-08-07 11:05:20 -03:00
parent 355c6b7473
commit 43d3d83f24

View file

@ -206,11 +206,13 @@ export class GBServer {
// ... some not authenticated middlewares
server.use((req, res, next) => {
if (req.originalUrl.startsWith('/logs')) {
var user = auth(req);
if (!user || !admins[user.name] || admins[user.name].password !== user.pass) {
res.set('WWW-Authenticate', 'Basic realm="example"');
return res.status(401).send();
}
}
return next();
});