express.basicAuth
is gonebasic-auth-connect
is deprecatedbasic-auth
doesn't have any logichttp-auth
is an overkillexpress-basic-auth
is what you wantSince you're using Express then you can use the express-basic-auth
middleware.
See the docs:
Example:
const app = require('express')();
const basicAuth = require('express-basic-auth');
app.use(basicAuth({
users: { admin: 'supersecret123' },
challenge: true // <--- needed to actually show the login dialog!
}));