Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit 8e7c2b4

Browse files
Dave Baileygregra81
authored andcommitted
SDK assumes scopes are required (#3)
Refresh token calls fail if no scopes are passed.
1 parent 57e94fe commit 8e7c2b4

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/Auth/TokenFetcher.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,10 @@ public function __construct(
7171
* @param array $scopes
7272
* @param array $additionalParams
7373
* @return array
74-
* @throws LogicException
7574
* @throws RuntimeException
7675
*/
7776
public function fetch($url, $grantType, array $scopes, array $additionalParams = [])
7877
{
79-
$this->validateScopesNotEmpty($scopes);
80-
8178
$formParams = array_merge([
8279
'client_id' => $this->configuration->getClientId(),
8380
'client_secret' => $this->configuration->getClientSecret(),
@@ -92,17 +89,6 @@ public function fetch($url, $grantType, array $scopes, array $additionalParams =
9289
return json_decode($response, true);
9390
}
9491

95-
/**
96-
* @param array $scopes
97-
* @throws LogicException
98-
*/
99-
public function validateScopesNotEmpty(array $scopes)
100-
{
101-
if (count($scopes) === 0) {
102-
throw new LogicException('Cannot fetch token when no scopes where defined');
103-
}
104-
}
105-
10692
/**
10793
* @param $url
10894
* @param $body
@@ -124,4 +110,4 @@ private function makeRequest($url, $body)
124110

125111
return (string)$response->getBody();
126112
}
127-
}
113+
}

0 commit comments

Comments
 (0)