diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 67f3d1d5..bf7b49f1 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -2746,7 +2746,7 @@ $(document).ready(function() { $("#pms-token-status").html(' Waiting for authentication...').fadeIn('fast'); } function OAuthSuccessCallback(authToken) { - $.post('save_pms_token', { token: authToken }, function() { + $.post('save_pms_token', { token: authToken, client_id: $('#pms_client_id').val() }, function() { showMsg(' Saved new Plex.tv token.', false, true, 5000); }); $("#pms-token-status").html(' Authentication successful.').fadeIn('fast'); diff --git a/data/interfaces/default/welcome.html b/data/interfaces/default/welcome.html index 2c60dc36..7c406e79 100644 --- a/data/interfaces/default/welcome.html +++ b/data/interfaces/default/welcome.html @@ -112,7 +112,7 @@
- + @@ -556,7 +556,7 @@ $(document).ready(function() { $("#pms-token-status").html(' Waiting for authentication...').fadeIn('fast'); } function OAuthSuccessCallback(authToken) { - $.post('save_pms_token', { token: authToken }, function () { + $.post('save_pms_token', { token: authToken, client_id: $('#pms_client_id').val() }, function () { $("#pms_token_validated").val(1); }); $("#pms-token-status").html(' Authentication successful.').fadeIn('fast'); diff --git a/plexpy/webserve.py b/plexpy/webserve.py index f929b778..ee34c8e2 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -207,7 +207,6 @@ class WebInterface(object): @requireAuth(member_of("admin")) def welcome(self, **kwargs): config = { - "pms_client_id": plexpy.CONFIG.PMS_CLIENT_ID, "pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER, "pms_ip": plexpy.CONFIG.PMS_IP, "pms_port": plexpy.CONFIG.PMS_PORT, @@ -228,10 +227,12 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def save_pms_token(self, token=None, **kwargs): + def save_pms_token(self, token=None, client_id=None, **kwargs): if token is not None: plexpy.CONFIG.PMS_TOKEN = token - plexpy.CONFIG.write() + if client_id is not None: + plexpy.CONFIG.PMS_CLIENT_ID = client_id + plexpy.CONFIG.write() @cherrypy.expose @cherrypy.tools.json_out()