Merge pull request #102 from antmicro/httpBasicAuth

Add simpler httpBasicAuth implementation
This commit is contained in:
Yuya Ochiai
2016-03-30 20:45:18 +09:00
2 changed files with 13 additions and 0 deletions

View File

@@ -49,6 +49,18 @@ var mainWindow = null;
var trayIcon = null;
var willAppQuit = false;
app.on('login', function(event, webContents, request, authInfo, callback) {
event.preventDefault();
var readlineSync = require('readline-sync');
console.log("HTTP basic auth requiring login, please provide login data.");
var username = readlineSync.question('Username: ');
var password = readlineSync.question('Password: ', {
hideEchoBack: true
});
console.log("Replacing default auth behaviour.");
callback(username, password);
});
// Quit when all windows are closed.
app.on('window-all-closed', function() {
// On OS X it is common for applications and their menu bar

View File

@@ -15,6 +15,7 @@
"react": "^0.14.3",
"react-bootstrap": "^0.28.1",
"react-dom": "^0.14.3",
"readline-sync": "^1.4.1",
"yargs": "^3.31.0"
}
}