mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-25 07:25:22 -07:00
Use redirection mechanism instead of popup for OAuth
This commit is contained in:
parent
d08b68ec25
commit
7a2745cc6a
1 changed files with 7 additions and 15 deletions
|
@ -78,6 +78,12 @@ export class LoginComponent implements OnDestroy, OnInit {
|
|||
if (authService.loggedIn()) {
|
||||
this.router.navigate(["search"]);
|
||||
}
|
||||
|
||||
let pinId = this.route.snapshot.queryParams["pinId"];
|
||||
if (pinId) {
|
||||
this.notify.info("Authenticating", "Loading... Please Wait");
|
||||
this.getPinResult(pinId);
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
@ -129,23 +135,9 @@ export class LoginComponent implements OnDestroy, OnInit {
|
|||
}
|
||||
|
||||
public oauth() {
|
||||
this.oAuthWindow = window.open(window.location.toString(), "_blank", `toolbar=0,
|
||||
location=0,
|
||||
status=0,
|
||||
menubar=0,
|
||||
scrollbars=1,
|
||||
resizable=1,
|
||||
width=500,
|
||||
height=500`);
|
||||
this.plexTv.GetPin(this.clientId, this.appName).subscribe((pin: any) => {
|
||||
|
||||
this.authService.login({ usePlexOAuth: true, password: "", rememberMe: true, username: "", plexTvPin: pin }).subscribe(x => {
|
||||
this.oAuthWindow!.location.replace(x.url);
|
||||
|
||||
this.pinTimer = setInterval(() => {
|
||||
this.notify.info("Authenticating", "Loading... Please Wait");
|
||||
this.getPinResult(x.pinId);
|
||||
}, 4000);
|
||||
window.location.replace(x.url + `&forwardUrl=${window.location.toString()}%3FpinId%3D${x.pinId}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue