Make sure token is saved before populating server dropdown list

This commit is contained in:
JonnyWong16 2022-07-14 16:14:10 -07:00
parent b6cb946ae2
commit b598e9fc0c
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 2 additions and 3 deletions

View file

@ -2757,10 +2757,10 @@ $(document).ready(function() {
function OAuthSuccessCallback(authToken) {
$.post('save_pms_token', { token: authToken, client_id: $('#pms_client_id').val() }, function() {
showMsg('<i class="fa fa-check"></i> Saved new Plex.tv token.', false, true, 5000);
getServerOptions();
});
$("#pms-token-status").html('<i class="fa fa-check"></i>&nbsp; Authentication successful.').fadeIn('fast');
$("#token_error_bar").hide();
getServerOptions(authToken);
}
function OAuthErrorCallback() {
$("#pms-token-status").html('<i class="fa fa-exclamation-circle"></i>&nbsp; Error communicating with Plex.tv.').fadeIn('fast');

View file

@ -541,10 +541,10 @@ $(document).ready(function() {
function OAuthSuccessCallback(authToken) {
$.post('save_pms_token', { token: authToken, client_id: $('#pms_client_id').val() }, function () {
$("#pms_token_validated").val(1);
getServerOptions();
});
$("#pms-token-status").html('<i class="fa fa-check"></i>&nbsp; Authentication successful.').fadeIn('fast');
authenticated = true;
getServerOptions(authToken);
}
function OAuthErrorCallback() {
$("#pms-token-status").html('<i class="fa fa-exclamation-circle"></i>&nbsp; Error communicating with Plex.tv.').fadeIn('fast');

View file

@ -164,7 +164,6 @@ class PlexTV(object):
if not self.token:
logger.error("Tautulli PlexTV :: PlexTV called, but no token provided.")
return
self.request_handler = http_handler.HTTPHandler(urls=self.urls,
token=self.token,