Skip to content
Permalink
Browse files

fix(Proxy): Fix issue with proxy authentication

  • Loading branch information...
adlk committed Jun 11, 2019
1 parent d6c7651 commit b9e5b2338fa44c48995c9f94cb057f5e0e622f1f
Showing with 11 additions and 3 deletions.
  1. +9 −1 src/index.js
  2. +1 −0 src/models/Service.js
  3. +1 −2 src/webview/recipe.js
@@ -354,18 +354,26 @@ app.on('ready', () => {
// TODO: rewrite to handle multiple login calls
const noop = () => null;
let authCallback = noop;

app.on('login', (event, webContents, request, authInfo, callback) => {
authCallback = callback;
debug('browser login event', authInfo);
event.preventDefault();

if (authInfo.isProxy && authInfo.scheme === 'basic') {
debug('Sending service echo ping');
webContents.send('get-service-id');

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

const ps = proxySettings.get(id);
callback(ps.user, ps.password);
if (ps) {
debug('Sending proxy auth callback for service', id);
callback(ps.user, ps.password);
} else {
debug('No proxy auth config found for', id);
}
});
} else if (authInfo.scheme === 'basic') {
debug('basic auth handler', authInfo);
@@ -116,6 +116,7 @@ export default class Service {

@computed get shareWithWebview() {
return {
id: this.id,
spellcheckerLanguage: this.spellcheckerLanguage,
isDarkModeEnabled: this.isDarkModeEnabled,
};
@@ -127,6 +127,7 @@ class RecipeController {
}

serviceIdEcho(event) {
debug('Received a service echo ping');
event.sender.send('service-id', this.settings.service.id);
}

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

console.log(element);

if (!element) return;

let value = '';

0 comments on commit b9e5b23

Please sign in to comment.
You can’t perform that action at this time.