mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Save client id with token
This commit is contained in:
parent
654ff7bdb6
commit
8bb83cff64
3 changed files with 7 additions and 6 deletions
|
@ -2746,7 +2746,7 @@ $(document).ready(function() {
|
|||
$("#pms-token-status").html('<i class="fa fa-refresh fa-spin"></i> 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('<i class="fa fa-check"></i> Saved new Plex.tv token.', false, true, 5000);
|
||||
});
|
||||
$("#pms-token-status").html('<i class="fa fa-check"></i> Authentication successful.').fadeIn('fast');
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<input type="hidden" id="pms_token_validated" value="0" data-validate="validatePMStoken">
|
||||
<input type="hidden" name="pms_client_id" id="pms_client_id" value="${config['pms_client_id']}">
|
||||
<input type="hidden" name="pms_client_id" id="pms_client_id" value="">
|
||||
<button id="sign-in-plex" class="btn btn-form" type="button">Sign In with Plex</button>
|
||||
<span style="margin-left: 10px; display: none;" id="pms-token-status"></span>
|
||||
</div>
|
||||
|
@ -556,7 +556,7 @@ $(document).ready(function() {
|
|||
$("#pms-token-status").html('<i class="fa fa-refresh fa-spin"></i> 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('<i class="fa fa-check"></i> Authentication successful.').fadeIn('fast');
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue