mirror of
https://github.com/appwrite/appwrite
synced 2026-05-21 07:58:55 +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
|
||||
{
|
||||
if(empty($this->tokens)) {
|
||||
$this->tokens = \json_decode($this->request(
|
||||
$response = $this->request(
|
||||
'POST',
|
||||
'https://github.com/login/oauth/access_token',
|
||||
[],
|
||||
|
|
@ -63,7 +63,11 @@ class Github extends OAuth2
|
|||
'client_secret' => $this->appSecret,
|
||||
'code' => $code
|
||||
])
|
||||
), true);
|
||||
);
|
||||
|
||||
$output = [];
|
||||
\parse_str($response, $output);
|
||||
$this->tokens = $output;
|
||||
}
|
||||
|
||||
return $this->tokens;
|
||||
|
|
|
|||
Loading…
Reference in a new issue