From 8e7c2b416e1f17790fbe5c355a3ed6d18507ec5c Mon Sep 17 00:00:00 2001 From: Dave Bailey Date: Sun, 3 Dec 2017 00:51:50 -0700 Subject: [PATCH] SDK assumes scopes are required (#3) Refresh token calls fail if no scopes are passed. --- lib/Auth/TokenFetcher.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/Auth/TokenFetcher.php b/lib/Auth/TokenFetcher.php index 7eb6d6d..d12b4e4 100644 --- a/lib/Auth/TokenFetcher.php +++ b/lib/Auth/TokenFetcher.php @@ -71,13 +71,10 @@ public function __construct( * @param array $scopes * @param array $additionalParams * @return array - * @throws LogicException * @throws RuntimeException */ public function fetch($url, $grantType, array $scopes, array $additionalParams = []) { - $this->validateScopesNotEmpty($scopes); - $formParams = array_merge([ 'client_id' => $this->configuration->getClientId(), 'client_secret' => $this->configuration->getClientSecret(), @@ -92,17 +89,6 @@ public function fetch($url, $grantType, array $scopes, array $additionalParams = return json_decode($response, true); } - /** - * @param array $scopes - * @throws LogicException - */ - public function validateScopesNotEmpty(array $scopes) - { - if (count($scopes) === 0) { - throw new LogicException('Cannot fetch token when no scopes where defined'); - } - } - /** * @param $url * @param $body @@ -124,4 +110,4 @@ private function makeRequest($url, $body) return (string)$response->getBody(); } -} \ No newline at end of file +}