server: add --authentication option

This commit is contained in:
bordun 2020-05-05 12:05:46 +02:00
parent 48807e9f85
commit 7cb729ff79
6 changed files with 57 additions and 5 deletions

View file

@ -57,6 +57,12 @@ module.exports = function(options={}) {
}
})
window.webContents.on('login', function(event, request, authInfo, callback) {
event.preventDefault()
var [name, pwd] = settings.read('authentication').split(':')
callback(name, pwd)
})
// window.webContents.on('will-navigate', (event)=>event.preventDefault())
window.webContents.on('new-window', (event, url)=>{
event.preventDefault()