Przeglądaj źródła

OMBI SSO with Plex Token (Ombi 3.0.3950 needed - Thanks Jamie)
fix url path for push state

causefx 7 lat temu
rodzic
commit
61219045bd
3 zmienionych plików z 7 dodań i 5 usunięć
  1. 4 2
      api/functions/sso-functions.php
  2. 1 1
      api/plugins/js/invites.js
  3. 2 2
      js/functions.js

+ 4 - 2
api/functions/sso-functions.php

@@ -34,10 +34,12 @@ function getOmbiToken($username, $password, $oAuthToken = null)
 		$data = array(
 			"username" => $username,
 			"password" => $password,
-			"rememberMe" => "true"
+			"rememberMe" => "true",
+			"plexToken" => $oAuthToken
 		);
+		$endpoint = ($oAuthToken) ? '/api/v1/Token/plextoken' : '/api/v1/Token';
 		$options = (localURL($url)) ? array('verify' => false) : array();
-		$response = Requests::post($url . '/api/v1/Token', $headers, json_encode($data), $options);
+		$response = Requests::post($url . $endpoint, $headers, json_encode($data), $options);
 		if ($response->success) {
 			$token = json_decode($response->body, true)['access_token'];
 			writeLog('success', 'Ombi Token Function - Grabbed token.', $username);

+ 1 - 1
api/plugins/js/invites.js

@@ -194,7 +194,7 @@ function getInvite(invite=null){
 		//show error page
 		$('.inviteModal').trigger('click');
         $('#inviteCodeInput').val(local('get', 'invite'));
-		window.history.pushState({}, document.title, "/" );
+		window.history.pushState({}, document.title, "./" );
         local('remove', 'invite');
 	}
 

+ 2 - 2
js/functions.js

@@ -3233,7 +3233,7 @@ function errorPage(error=null,uri=null){
 		$('.error-page').html(buildErrorPage(local('get', 'error')));
 		$('.error-page').fadeIn();
 		local('remove', 'error');
-		window.history.pushState({}, document.title, "/" );
+		window.history.pushState({}, document.title, "./" );
 	}
 
 }
@@ -4498,7 +4498,7 @@ function buildDownloaderCombined(source){
     var header = '';
 
 
-    var menu = `<ul class="nav customtab nav-tabs pull-right" role="tablist">`;
+    var menu = `<ul class="nav customtab nav-tabs m-t-5" role="tablist">`;
     if(queue){
         menu += `
 			<li role="presentation" class="active" onclick="homepageDownloader('`+source+`')"><a href="#`+source+`-queue" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"><span class="visible-xs"><i class="ti-download"></i></span><span class="hidden-xs">`+queueButton+`</span></a></li>