1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00

Unable to use GitHub OAuth provider

Fixes #456
This commit is contained in:
Eldad Fux 2020-06-28 01:30:03 +03:00
parent 0ff3fda3ac
commit fbddc7c7eb
2 changed files with 4 additions and 3 deletions

View file

@ -138,7 +138,7 @@ abstract class OAuth2
\curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
\curl_setopt($ch, CURLOPT_HEADER, 0);
\curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
\curl_setopt($ch, CURLOPT_USERAGENT, '');
\curl_setopt($ch, CURLOPT_USERAGENT, 'Appwrite OAuth2');
if (!empty($payload)) {
\curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

View file

@ -15,7 +15,7 @@ class Github extends OAuth2
* @var array
*/
protected $scopes = [
'user:email'
'user',
];
/**
@ -78,6 +78,7 @@ class Github extends OAuth2
{
$user = $this->getUser($accessToken);
var_dump($user);
if (isset($user['id'])) {
return $user['id'];
}