aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js10
1 files changed, 9 insertions, 1 deletions
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', () => {
354// TODO: rewrite to handle multiple login calls 354// TODO: rewrite to handle multiple login calls
355const noop = () => null; 355const noop = () => null;
356let authCallback = noop; 356let authCallback = noop;
357
357app.on('login', (event, webContents, request, authInfo, callback) => { 358app.on('login', (event, webContents, request, authInfo, callback) => {
358 authCallback = callback; 359 authCallback = callback;
359 debug('browser login event', authInfo); 360 debug('browser login event', authInfo);
360 event.preventDefault(); 361 event.preventDefault();
362
361 if (authInfo.isProxy && authInfo.scheme === 'basic') { 363 if (authInfo.isProxy && authInfo.scheme === 'basic') {
364 debug('Sending service echo ping');
362 webContents.send('get-service-id'); 365 webContents.send('get-service-id');
363 366
364 ipcMain.once('service-id', (e, id) => { 367 ipcMain.once('service-id', (e, id) => {
365 debug('Received service id', id); 368 debug('Received service id', id);
366 369
367 const ps = proxySettings.get(id); 370 const ps = proxySettings.get(id);
368 callback(ps.user, ps.password); 371 if (ps) {
372 debug('Sending proxy auth callback for service', id);
373 callback(ps.user, ps.password);
374 } else {
375 debug('No proxy auth config found for', id);
376 }
369 }); 377 });
370 } else if (authInfo.scheme === 'basic') { 378 } else if (authInfo.scheme === 'basic') {
371 debug('basic auth handler', authInfo); 379 debug('basic auth handler', authInfo);