Merge pull request #85 from vvalchev/logout_support
re-authentication support
This commit is contained in:
commit
a518f0748f
2 changed files with 16 additions and 1 deletions
|
@ -35,6 +35,19 @@ app.disable('x-powered-by')
|
|||
// static files
|
||||
app.use(express.static(publicPath, expressOptions))
|
||||
|
||||
app.get('/reauth', function (req, res, next) {
|
||||
var r = req.headers.referer || '/';
|
||||
res.status(401).send(
|
||||
'<html>' +
|
||||
' <head>' +
|
||||
' <meta http-equiv="refresh" content="1; url=' + r + '" />' +
|
||||
' </head>' +
|
||||
' <body>' +
|
||||
' <a href="' + r + '">Go Back</a>' +
|
||||
' </body>' +
|
||||
'</html>');
|
||||
})
|
||||
|
||||
app.get('/ssh/host/:host?', function (req, res, next) {
|
||||
res.sendFile(path.join(path.join(publicPath, 'client.htm')))
|
||||
// capture, assign, and validated variables
|
||||
|
|
|
@ -7,7 +7,9 @@ var SSH = require('ssh2').Client
|
|||
// var fs = require('fs')
|
||||
// var hostkeys = JSON.parse(fs.readFileSync('./hostkeyhashes.json', 'utf8'))
|
||||
var termCols, termRows
|
||||
var menuData = '<a id="logBtn"><i class="fas fa-clipboard fa-fw"></i> Start Log</a><a id="downloadLogBtn"><i class="fas fa-download fa-fw"></i> Download Log</a>'
|
||||
var menuData = '<a id="logBtn"><i class="fas fa-clipboard fa-fw"></i> Start Log</a>' +
|
||||
'<a id="downloadLogBtn"><i class="fas fa-download fa-fw"></i> Download Log</a>' +
|
||||
'<a style="color:black" href="/reauth"><i class="fas fa-key fa-fw"></i> Switch User</a>';
|
||||
|
||||
// public
|
||||
module.exports = function socket (socket) {
|
||||
|
|
Loading…
Reference in a new issue