Add popup OAuth window to wizard and settings

This commit is contained in:
JonnyWong16 2018-07-03 09:49:11 -07:00
parent d9ea781462
commit c2ba2b4e98
2 changed files with 12 additions and 2 deletions

View file

@ -2294,7 +2294,9 @@ $(document).ready(function() {
const code = data.code;
var keep_polling = true;
window.open('https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + code);
var plex_oauth_window = PopupCenter(
'https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + code,
'Plex-OAuth', 600, 700);
(function poll() {
polling = setTimeout(function () {
@ -2306,6 +2308,9 @@ $(document).ready(function() {
if (data.authToken){
var authToken = data.authToken;
keep_polling = false;
if (plex_oauth_window) {
plex_oauth_window.close();
}
$("#pms_token").val(authToken);
$("#pms_uuid").val(x_plex_headers['X-Plex-Client-Identifier']);
$("#token_verify").html('<i class="fa fa-check"></i>').fadeIn('fast');

View file

@ -507,7 +507,9 @@ $(document).ready(function() {
const code = data.code;
var keep_polling = true;
window.open('https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + code);
var plex_oauth_window = PopupCenter(
'https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + code,
'Plex-OAuth', 600, 700);
(function poll() {
polling = setTimeout(function () {
@ -519,6 +521,9 @@ $(document).ready(function() {
if (data.authToken){
var authToken = data.authToken;
keep_polling = false;
if (plex_oauth_window) {
plex_oauth_window.close();
}
$("#pms_token").val(authToken);
$("#pms-token-status").html('<i class="fa fa-check"></i>&nbsp; Authentication successful.').fadeIn('fast');
authenticated = true;