diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-06-11 15:55:04 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-06-11 15:55:04 +0200 |
commit | b9e5b2338fa44c48995c9f94cb057f5e0e622f1f (patch) | |
tree | 218353d59c721531e943f4f2df23bf6c048a7605 /src/index.js | |
parent | Merge branch 'release/5.2.0-beta.1' into fix/fix-proxy-auth (diff) | |
download | ferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.tar.gz ferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.tar.zst ferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.zip |
fix(Proxy): Fix issue with proxy authentication
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 10 |
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 |
355 | const noop = () => null; | 355 | const noop = () => null; |
356 | let authCallback = noop; | 356 | let authCallback = noop; |
357 | |||
357 | app.on('login', (event, webContents, request, authInfo, callback) => { | 358 | app.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); |