From bf7c48e9a76bc8aa45fc9211f997138cb309b412 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 13 Apr 2017 21:49:09 +0200 Subject: [PATCH] :bug: handle proxy auth window closing --- src/vs/code/electron-main/auth.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts index 27c4e6d2f1d..69b4e8dc511 100644 --- a/src/vs/code/electron-main/auth.ts +++ b/src/vs/code/electron-main/auth.ts @@ -77,8 +77,13 @@ export class ProxyAuthHandler { const javascript = 'promptForCredentials(' + JSON.stringify(data) + ')'; event.preventDefault(); + + const onWindowClose = () => cb('', ''); + win.on('close', onWindowClose); + win.webContents.executeJavaScript(javascript, true).then(({ username, password }: Credentials) => { cb(username, password); + win.removeListener('close', onWindowClose); win.close(); }); }