aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js
index 3fe996aa7..55592c328 100644
--- a/src/index.js
+++ b/src/index.js
@@ -180,6 +180,7 @@ const createWindow = () => {
180 backgroundColor: !settings.get('darkMode') ? '#3498db' : '#1E1E1E', 180 backgroundColor: !settings.get('darkMode') ? '#3498db' : '#1E1E1E',
181 webPreferences: { 181 webPreferences: {
182 nodeIntegration: true, 182 nodeIntegration: true,
183 webviewTag: true,
183 }, 184 },
184 }); 185 });
185 186
@@ -353,18 +354,26 @@ app.on('ready', () => {
353// TODO: rewrite to handle multiple login calls 354// TODO: rewrite to handle multiple login calls
354const noop = () => null; 355const noop = () => null;
355let authCallback = noop; 356let authCallback = noop;
357
356app.on('login', (event, webContents, request, authInfo, callback) => { 358app.on('login', (event, webContents, request, authInfo, callback) => {
357 authCallback = callback; 359 authCallback = callback;
358 debug('browser login event', authInfo); 360 debug('browser login event', authInfo);
359 event.preventDefault(); 361 event.preventDefault();
362
360 if (authInfo.isProxy && authInfo.scheme === 'basic') { 363 if (authInfo.isProxy && authInfo.scheme === 'basic') {
364 debug('Sending service echo ping');
361 webContents.send('get-service-id'); 365 webContents.send('get-service-id');
362 366
363 ipcMain.once('service-id', (e, id) => { 367 ipcMain.once('service-id', (e, id) => {
364 debug('Received service id', id); 368 debug('Received service id', id);
365 369
366 const ps = proxySettings.get(id); 370 const ps = proxySettings.get(id);
367 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 }
368 }); 377 });
369 } else if (authInfo.scheme === 'basic') { 378 } else if (authInfo.scheme === 'basic') {
370 debug('basic auth handler', authInfo); 379 debug('basic auth handler', authInfo);