From b9e5b2338fa44c48995c9f94cb057f5e0e622f1f Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 11 Jun 2019 15:55:04 +0200 Subject: fix(Proxy): Fix issue with proxy authentication --- src/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 49cf07618..55592c328 100644 --- a/src/index.js +++ b/src/index.js @@ -354,18 +354,26 @@ app.on('ready', () => { // TODO: rewrite to handle multiple login calls const noop = () => null; let authCallback = noop; + app.on('login', (event, webContents, request, authInfo, callback) => { authCallback = callback; debug('browser login event', authInfo); event.preventDefault(); + if (authInfo.isProxy && authInfo.scheme === 'basic') { + debug('Sending service echo ping'); webContents.send('get-service-id'); ipcMain.once('service-id', (e, id) => { debug('Received service id', id); const ps = proxySettings.get(id); - callback(ps.user, ps.password); + if (ps) { + debug('Sending proxy auth callback for service', id); + callback(ps.user, ps.password); + } else { + debug('No proxy auth config found for', id); + } }); } else if (authInfo.scheme === 'basic') { debug('basic auth handler', authInfo); -- cgit v1.2.3-70-g09d2