Only add users to basicAuth when password is truthy

This commit is contained in:
michael-pattern 2024-05-08 17:52:05 -04:00
parent 58233a2fd5
commit 26471517a9

View File

@ -48,7 +48,7 @@ function start() {
if (logins && process.env.BASIC_AUTH) {
app.use(
basicAuth({
users: _.fromPairs(logins.map(x => [x.login, x.password])),
users: _.fromPairs(logins.filter(x => x.password).map(x => [x.login, x.password])),
challenge: true,
realm: 'DbGate Web App',
})