mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Fixed GitHub response parsing
This commit is contained in:
parent
f57a48d7a3
commit
a8a61701b2
1 changed files with 6 additions and 2 deletions
|
|
@ -53,7 +53,7 @@ class Github extends OAuth2
|
||||||
protected function getTokens(string $code): array
|
protected function getTokens(string $code): array
|
||||||
{
|
{
|
||||||
if(empty($this->tokens)) {
|
if(empty($this->tokens)) {
|
||||||
$this->tokens = \json_decode($this->request(
|
$response = $this->request(
|
||||||
'POST',
|
'POST',
|
||||||
'https://github.com/login/oauth/access_token',
|
'https://github.com/login/oauth/access_token',
|
||||||
[],
|
[],
|
||||||
|
|
@ -63,7 +63,11 @@ class Github extends OAuth2
|
||||||
'client_secret' => $this->appSecret,
|
'client_secret' => $this->appSecret,
|
||||||
'code' => $code
|
'code' => $code
|
||||||
])
|
])
|
||||||
), true);
|
);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
\parse_str($response, $output);
|
||||||
|
$this->tokens = $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->tokens;
|
return $this->tokens;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue