浏览代码

fix cert issue on trakt oauth (#1872)

CauseFX 3 年之前
父节点
当前提交
818646562b
共有 1 个文件被更改,包括 10 次插入7 次删除
  1. 10 7
      api/functions/oauth.php

+ 10 - 7
api/functions/oauth.php

@@ -4,13 +4,16 @@ trait OAuthFunctions
 {
 {
 	public function traktOAuth()
 	public function traktOAuth()
 	{
 	{
-		$provider = new Bogstag\OAuth2\Client\Provider\Trakt([
-			'clientId' => $this->config['traktClientId'],
-			'clientSecret' => $this->config['traktClientSecret'],
-			'redirectUri' => $this->getServerPath() . 'api/v2/oauth/trakt'
-		], [
-			'httpClient' => new GuzzleHttp\Client(['verify' => getCert()]),
-		]);
+		$provider = new Bogstag\OAuth2\Client\Provider\Trakt(
+			[
+				'clientId' => $this->config['traktClientId'],
+				'clientSecret' => $this->config['traktClientSecret'],
+				'redirectUri' => $this->getServerPath() . 'api/v2/oauth/trakt'
+			],
+			[
+				'httpClient' => new GuzzleHttp\Client(['verify' => $this->getCert()]),
+			]
+		);
 		if (!isset($_GET['code'])) {
 		if (!isset($_GET['code'])) {
 			$authUrl = $provider->getAuthorizationUrl();
 			$authUrl = $provider->getAuthorizationUrl();
 			header('Location: ' . $authUrl);
 			header('Location: ' . $authUrl);