Merge pull request #113 from vvalchev/re-request-auth-on-login-failure

Fixes #112 - Re-auth doesn't work if incorrect auth was provided initially
This commit is contained in:
Bill Church 2018-11-07 07:24:41 -05:00 committed by GitHub
commit 9f551774f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

File diff suppressed because one or more lines are too long

View file

@ -156,6 +156,8 @@ socket.on('error', function (err) {
}
})
socket.on('reauth',reauthSession)
term.on('title', function (title) {
document.title = title
})

View file

@ -152,6 +152,8 @@ module.exports = function socket (socket) {
console.log('WebSSH2 ' + 'error: Authentication failure'.red.bold +
' user=' + socket.request.session.username.yellow.bold.underline +
' from=' + socket.handshake.address.yellow.bold.underline)
socket.emit('reauth')
} else {
console.log('WebSSH2 Logout: user=' + socket.request.session.username + ' from=' + socket.handshake.address + ' host=' + socket.request.session.ssh.host + ' port=' + socket.request.session.ssh.port + ' sessionID=' + socket.request.sessionID + '/' + socket.id + ' allowreplay=' + socket.request.session.ssh.allowreplay + ' term=' + socket.request.session.ssh.term)
if (err) {