Skip to content

Commit

Permalink
refactor: updated http-auth dependency
Browse files Browse the repository at this point in the history
http-auth: added necessary new dependency http-auth-connect that provides the method .connect that got extracted from the original one.
  • Loading branch information
mfranzke committed Nov 29, 2021
1 parent 57aad3d commit a3e39e6
Show file tree
Hide file tree
Showing 3 changed files with 1,943 additions and 1,842 deletions.
3 changes: 2 additions & 1 deletion packages/live-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,12 @@ LiveServer.start = function (options) {
// Use http-auth if configured
if (htpasswd !== null) {
const auth = require('http-auth');
const authConnect = require('http-auth-connect');
const basic = auth.basic({
realm: 'Please authorize',
file: htpasswd,
});
app.use(auth.connect(basic));
app.use(authConnect(basic));
}

if (cors) {
Expand Down
3 changes: 2 additions & 1 deletion packages/live-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"cors": "2.8.5",
"event-stream": "3.3.4",
"faye-websocket": "0.11.x",
"http-auth": "3.2.x",
"http-auth": "4.1.x",
"http-auth-connect": "^1.0.5",
"morgan": "1.10.0",
"object-assign": "4.1.1",
"opn": "5.3.0",
Expand Down
Loading

0 comments on commit a3e39e6

Please sign in to comment.