Skip to content

Commit

Permalink
Override abstract provider for Twitter's OAuth 2.0 provider (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldyrynda committed Feb 7, 2022
1 parent fe9b8ed commit 9b96dfd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Two/TwitterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,18 @@ protected function mapUserToObject(array $user)
'avatar' => $user['profile_image_url'],
]);
}

/**
* {@inheritdoc}
*/
public function getAccessTokenResponse($code)
{
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
'headers' => ['Accept' => 'application/json'],
'auth' => [$this->clientId, $this->clientSecret],
'form_params' => $this->getTokenFields($code),
]);

return json_decode($response->getBody(), true);
}
}

0 comments on commit 9b96dfd

Please sign in to comment.