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

Commit ee80a10

Browse files
committed
:octocat:
1 parent c0bd955 commit ee80a10

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Core/OAuth2Provider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ public function getAuthURL(array $params = null, array $scopes = null):UriInterf
6464
'client_id' => $this->options->key,
6565
'redirect_uri' => $this->options->callbackURL,
6666
'response_type' => 'code',
67-
'scope' => implode($this->scopesDelimiter, $scopes),
6867
'type' => 'web_server',
6968
]);
7069

70+
if($scopes !== null){
71+
$params['scope'] = implode($this->scopesDelimiter, $scopes);
72+
}
73+
7174
if($this instanceof CSRFToken){
7275
$params = $this->setState($params);
7376
}

src/Core/OAuthProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ public function __construct(HttpClient $http, OAuthStorageInterface $storage, Se
149149
*
150150
* @return string|null
151151
*/
152-
public function __get(string $name){
152+
public function __get(string $name):?string{
153153

154-
if(!in_array($name, ['serviceName', 'authURL', 'accessTokenURL', 'revokeURL', 'userRevokeURL'], true)){
154+
if(!in_array($name, ['serviceName', 'authURL', 'accessTokenURL', 'revokeURL', 'userRevokeURL', 'apiURL'], true)){
155155
return null;
156156
}
157157

@@ -283,9 +283,9 @@ public function request(string $path, array $params = null, string $method = nul
283283
}
284284

285285
$request = $this->requestFactory
286-
->createRequest($method ?? 'GET', Psr7\merge_query($this->apiURL.$path, $params));
286+
->createRequest($method ?? 'GET', Psr7\merge_query($this->apiURL.$path, $params ?? []));
287287

288-
foreach(array_merge($this->apiHeaders, $headers) as $header => $value){
288+
foreach(array_merge($this->apiHeaders, $headers ?? []) as $header => $value){
289289
$request = $request->withAddedHeader($header, $value);
290290
}
291291

0 commit comments

Comments
 (0)