From 061f4d4836f8dd9ef2a73b4f1d7315b0a5a61466 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 8 Oct 2019 01:09:01 +0530 Subject: [PATCH] chore: disabled twitter --- app/config/providers.php | 2 +- app/controllers/auth.php | 3 --- src/Auth/OAuth.php | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/config/providers.php b/app/config/providers.php index 7caef0c51..3e609e1fd 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -74,6 +74,6 @@ return [ 'twitter' => [ 'developers' => 'https://developer.twitter.com/', 'icon' => 'icon-twitter', - 'enabled' => true, + 'enabled' => false, ], ]; diff --git a/app/controllers/auth.php b/app/controllers/auth.php index 849f78311..32cdf4a6c 100644 --- a/app/controllers/auth.php +++ b/app/controllers/auth.php @@ -730,9 +730,6 @@ $utopia->get('/v1/auth/oauth/:provider/redirect') $defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => '']; $validateURL = new URL(); - // Uncomment this while testing amazon oAuth - // $state = html_entity_decode($state); - $appId = $project->getAttribute('usersOauth'.ucfirst($provider).'Appid', ''); $appSecret = $project->getAttribute('usersOauth'.ucfirst($provider).'Secret', '{}'); diff --git a/src/Auth/OAuth.php b/src/Auth/OAuth.php index a96ebb7a6..87991f4e4 100644 --- a/src/Auth/OAuth.php +++ b/src/Auth/OAuth.php @@ -78,16 +78,16 @@ abstract class OAuth */ abstract public function getUserName(string $accessToken):string; + // The parseState function was designed specifically for Amazon OAuth Adapter to override. // The response from Amazon is html encoded and hence it needs to be html_decoded before // json_decoding - /** * @param $state * - * @return json + * @return string */ - public function parseState(string $state) + public function parseState(string $state): string { return json_decode($state, true); }