From 036230d4cff47a09239de8e2b32a86ba4645e831 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Tue, 3 Sep 2019 12:14:22 +0100 Subject: [PATCH] Fixed #3143 --- src/Ombi/ClientApp/src/app/login/login.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/login/login.component.ts b/src/Ombi/ClientApp/src/app/login/login.component.ts index ebd199382..a08e3d87b 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.ts +++ b/src/Ombi/ClientApp/src/app/login/login.component.ts @@ -139,8 +139,10 @@ export class LoginComponent implements OnDestroy, OnInit { }); } + private oAuthWindow: Window; + public oauth() { - const oAuthWindow = window.open(window.location.toString(), "_blank", `toolbar=0, + this.oAuthWindow = window.open(window.location.toString(), "_blank", `toolbar=0, location=0, status=0, menubar=0, @@ -151,7 +153,7 @@ export class LoginComponent implements OnDestroy, OnInit { this.plexTv.GetPin(this.clientId, this.appName).subscribe((pin: any) => { this.authService.login({ usePlexOAuth: true, password: "", rememberMe: true, username: "", plexTvPin: pin }).subscribe(x => { - oAuthWindow!.location.replace(x.url); + this.oAuthWindow!.location.replace(x.url); this.pinTimer = setInterval(() => { @@ -171,6 +173,7 @@ export class LoginComponent implements OnDestroy, OnInit { if (this.authService.loggedIn()) { this.ngOnDestroy(); + this.oAuthWindow.close(); this.router.navigate(["search"]); return; }