Merge pull request #457 from appwrite/eldadfux/issue456
Unable to use GitHub OAuth provider
This commit is contained in:
commit
17b9dc76a6
5 changed files with 13 additions and 12 deletions
|
@ -36,6 +36,7 @@
|
|||
- Fixed bug preventing the deletion of the project logo
|
||||
- Fixed Bug when trying to overwrite OAuth cookie in the Flutter SDK
|
||||
- Fixed OAuth redirect when using the self-hosted instance default success URL ([#454](https://github.com/appwrite/appwrite/issues/454))
|
||||
- Fixed bug denying authentication with Github OAuth provider
|
||||
|
||||
## Security
|
||||
|
||||
|
|
15
composer.lock
generated
15
composer.lock
generated
|
@ -2141,24 +2141,23 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||
"reference": "790426f28bfcbfc1a6f1d59ee8c986edfa45395c"
|
||||
"reference": "664187301bfbc87e686df212094e6817805c3ab8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/790426f28bfcbfc1a6f1d59ee8c986edfa45395c",
|
||||
"reference": "790426f28bfcbfc1a6f1d59ee8c986edfa45395c",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/664187301bfbc87e686df212094e6817805c3ab8",
|
||||
"reference": "664187301bfbc87e686df212094e6817805c3ab8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-filter": "^7.1",
|
||||
"php": "^7.2",
|
||||
"ext-filter": "*",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"phpdocumentor/reflection-common": "^2.0",
|
||||
"phpdocumentor/type-resolver": "^1.0",
|
||||
"webmozart/assert": "^1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/instantiator": "^1",
|
||||
"mockery/mockery": "^1"
|
||||
"mockery/mockery": "1.3.*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
@ -2186,7 +2185,7 @@
|
|||
}
|
||||
],
|
||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||
"time": "2020-06-19T18:58:43+00:00"
|
||||
"time": "2020-06-27T17:33:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/type-resolver",
|
||||
|
|
|
@ -50,7 +50,7 @@ services:
|
|||
- ./phpunit.xml:/usr/share/nginx/html/phpunit.xml
|
||||
- ./tests:/usr/share/nginx/html/tests
|
||||
- ./app:/usr/share/nginx/html/app
|
||||
# - ./vendor:/usr/share/nginx/html/vendor
|
||||
# - ./vendor:/usr/share/nginx/html/vendor
|
||||
- ./docs:/usr/share/nginx/html/docs
|
||||
- ./public:/usr/share/nginx/html/public
|
||||
- ./src:/usr/share/nginx/html/src
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -15,7 +15,7 @@ class Github extends OAuth2
|
|||
* @var array
|
||||
*/
|
||||
protected $scopes = [
|
||||
'user:email'
|
||||
'user:email',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,7 @@ class Github extends OAuth2
|
|||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
var_dump($user);
|
||||
if (isset($user['id'])) {
|
||||
return $user['id'];
|
||||
}
|
Loading…
Reference in a new issue