aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/Service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/Service.ts')
-rw-r--r--src/models/Service.ts42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/models/Service.ts b/src/models/Service.ts
index 493620ba4..0cbfa60e2 100644
--- a/src/models/Service.ts
+++ b/src/models/Service.ts
@@ -527,27 +527,29 @@ export default class Service {
527 this._didMediaPaused(); 527 this._didMediaPaused();
528 }); 528 });
529 529
530 webviewWebContents.on('login', (event, _, authInfo, callback) => { 530 if (webviewWebContents) {
531 // const authCallback = callback; 531 webviewWebContents.on('login', (event, _, authInfo, callback) => {
532 debug('browser login event', authInfo); 532 // const authCallback = callback;
533 event.preventDefault(); 533 debug('browser login event', authInfo);
534 534 event.preventDefault();
535 if (authInfo.isProxy && authInfo.scheme === 'basic') { 535
536 debug('Sending service echo ping'); 536 if (authInfo.isProxy && authInfo.scheme === 'basic') {
537 webviewWebContents.send('get-service-id'); 537 debug('Sending service echo ping');
538 538 webviewWebContents.send('get-service-id');
539 debug('Received service id', this.id); 539
540 540 debug('Received service id', this.id);
541 const ps = stores.settings.proxy[this.id]; 541
542 542 const ps = stores.settings.proxy[this.id];
543 if (ps) { 543
544 debug('Sending proxy auth callback for service', this.id); 544 if (ps) {
545 callback(ps.user, ps.password); 545 debug('Sending proxy auth callback for service', this.id);
546 } else { 546 callback(ps.user, ps.password);
547 debug('No proxy auth config found for', this.id); 547 } else {
548 debug('No proxy auth config found for', this.id);
549 }
548 } 550 }
549 } 551 });
550 }); 552 }
551 } 553 }
552 554
553 initializeWebViewListener(): void { 555 initializeWebViewListener(): void {