aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-06-11 15:55:04 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-06-11 15:55:04 +0200
commitb9e5b2338fa44c48995c9f94cb057f5e0e622f1f (patch)
tree218353d59c721531e943f4f2df23bf6c048a7605 /src
parentMerge branch 'release/5.2.0-beta.1' into fix/fix-proxy-auth (diff)
downloadferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.tar.gz
ferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.tar.zst
ferdium-app-b9e5b2338fa44c48995c9f94cb057f5e0e622f1f.zip
fix(Proxy): Fix issue with proxy authentication
Diffstat (limited to 'src')
-rw-r--r--src/index.js10
-rw-r--r--src/models/Service.js1
-rw-r--r--src/webview/recipe.js3
3 files changed, 11 insertions, 3 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);
diff --git a/src/models/Service.js b/src/models/Service.js
index a118c093e..88bce3360 100644
--- a/src/models/Service.js
+++ b/src/models/Service.js
@@ -116,6 +116,7 @@ export default class Service {
116 116
117 @computed get shareWithWebview() { 117 @computed get shareWithWebview() {
118 return { 118 return {
119 id: this.id,
119 spellcheckerLanguage: this.spellcheckerLanguage, 120 spellcheckerLanguage: this.spellcheckerLanguage,
120 isDarkModeEnabled: this.isDarkModeEnabled, 121 isDarkModeEnabled: this.isDarkModeEnabled,
121 }; 122 };
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 1e5d74b1f..c223b73de 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -127,6 +127,7 @@ class RecipeController {
127 } 127 }
128 128
129 serviceIdEcho(event) { 129 serviceIdEcho(event) {
130 debug('Received a service echo ping');
130 event.sender.send('service-id', this.settings.service.id); 131 event.sender.send('service-id', this.settings.service.id);
131 } 132 }
132 133
@@ -137,8 +138,6 @@ class RecipeController {
137 window.addEventListener('keyup', debounce((e) => { 138 window.addEventListener('keyup', debounce((e) => {
138 const element = e.target; 139 const element = e.target;
139 140
140 console.log(element);
141
142 if (!element) return; 141 if (!element) return;
143 142
144 let value = ''; 143 let value = '';