Fixes issue #4
Add a test for a blank (not null) username. Also added feature to re-prompt for credentials if none are entered.
This commit is contained in:
parent
b86ae3e88d
commit
e06d2570ae
1 changed files with 4 additions and 0 deletions
4
index.js
4
index.js
|
@ -40,6 +40,10 @@ app.use(express.static(__dirname + '/public')).use(function(req, res, next) {
|
|||
res.statusCode = 401;
|
||||
res.setHeader('WWW-Authenticate', 'Basic realm="WebSSH"');
|
||||
res.end('Username and password required for web SSH service.');
|
||||
} else if (myAuth.name == "") {
|
||||
res.statusCode = 401
|
||||
res.setHeader('WWW-Authenticate', 'Basic realm="WebSSH"');
|
||||
res.end('Username and password required for web SSH service.');
|
||||
} else {
|
||||
config.user.name = myAuth.name;
|
||||
config.user.password = myAuth.pass;
|
||||
|
|
Loading…
Reference in a new issue