Skip to content

Commit b9e5b23

Browse files
committed
fix(Proxy): Fix issue with proxy authentication
1 parent d6c7651 commit b9e5b23

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,26 @@ app.on('ready', () => {
354354
// TODO: rewrite to handle multiple login calls
355355
const noop = () => null;
356356
let authCallback = noop;
357+
357358
app.on('login', (event, webContents, request, authInfo, callback) => {
358359
authCallback = callback;
359360
debug('browser login event', authInfo);
360361
event.preventDefault();
362+
361363
if (authInfo.isProxy && authInfo.scheme === 'basic') {
364+
debug('Sending service echo ping');
362365
webContents.send('get-service-id');
363366

364367
ipcMain.once('service-id', (e, id) => {
365368
debug('Received service id', id);
366369

367370
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+
}
369377
});
370378
} else if (authInfo.scheme === 'basic') {
371379
debug('basic auth handler', authInfo);

src/models/Service.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export default class Service {
116116

117117
@computed get shareWithWebview() {
118118
return {
119+
id: this.id,
119120
spellcheckerLanguage: this.spellcheckerLanguage,
120121
isDarkModeEnabled: this.isDarkModeEnabled,
121122
};

src/webview/recipe.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class RecipeController {
127127
}
128128

129129
serviceIdEcho(event) {
130+
debug('Received a service echo ping');
130131
event.sender.send('service-id', this.settings.service.id);
131132
}
132133

@@ -137,8 +138,6 @@ class RecipeController {
137138
window.addEventListener('keyup', debounce((e) => {
138139
const element = e.target;
139140

140-
console.log(element);
141-
142141
if (!element) return;
143142

144143
let value = '';

0 commit comments

Comments
 (0)