mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
fix(oauth): 🔒 Fixed the issue where some users running their browsers in a different language could not open the Plex OAuth window
#4408
This commit is contained in:
parent
209e31175c
commit
d5404eaad7
2 changed files with 10 additions and 6 deletions
|
@ -177,6 +177,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
|||
if (this.oAuthWindow) {
|
||||
this.oAuthWindow.close();
|
||||
}
|
||||
|
||||
this.oAuthWindow = window.open(
|
||||
window.location.toString(),
|
||||
"_blank",
|
||||
|
@ -214,6 +215,11 @@ export class LoginComponent implements OnDestroy, OnInit {
|
|||
}
|
||||
|
||||
public getPinResult(pinId: number) {
|
||||
if (this.oAuthWindow.closed) {
|
||||
if (this.pinTimer) {
|
||||
clearInterval(this.pinTimer);
|
||||
}
|
||||
}
|
||||
this.authService.oAuth(pinId).subscribe(
|
||||
(x) => {
|
||||
if (x.access_token) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { PlatformLocation, APP_BASE_HREF } from "@angular/common";
|
||||
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||
import { Injectable, Inject } from "@angular/core";
|
||||
|
||||
import { Observable } from "rxjs";
|
||||
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||
|
||||
import { IPlexPin } from "../../interfaces";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Injectable()
|
||||
export class PlexTvService {
|
||||
|
@ -13,7 +11,7 @@ export class PlexTvService {
|
|||
}
|
||||
|
||||
public GetPin(clientId: string, applicationName: string): Observable<IPlexPin> {
|
||||
const headers = new HttpHeaders({"Content-Type": "application/json",
|
||||
const headers = new HttpHeaders({"Content-Type": "application/json; charset=ISO-8859-1",
|
||||
"X-Plex-Client-Identifier": clientId,
|
||||
"X-Plex-Product": applicationName,
|
||||
"X-Plex-Version": "3",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue