Procházet zdrojové kódy

added check for response to Overseerr test

Nico Bleiler před 3 roky
rodič
revize
44e12c4067
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      api/homepage/overseerr.php

+ 2 - 1
api/homepage/overseerr.php

@@ -69,7 +69,8 @@ trait OverseerrHomepageItem
 		try {
 		try {
 			$options = $this->requestOptions($url, null, $this->config['overseerrDisableCertCheck'], $this->config['overseerrUseCustomCertificate']);
 			$options = $this->requestOptions($url, null, $this->config['overseerrDisableCertCheck'], $this->config['overseerrUseCustomCertificate']);
 			$test = Requests::get($url . "/api/v1/settings/main", $headers, $options);
 			$test = Requests::get($url . "/api/v1/settings/main", $headers, $options);
-			if ($test->success) {
+			$testData = json_decode($test->body, true);
+			if ($test->success && isset($testData["apiKey"]) && $testData["apiKey"] == $this->config['overseerrToken']) {
 				$this->setAPIResponse('success', 'API Connection succeeded', 200);
 				$this->setAPIResponse('success', 'API Connection succeeded', 200);
 				return true;
 				return true;
 			} else {
 			} else {