diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6a1204f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog # + +This project uses [semantic versioning](https://semver.org). + +## Version 1 + +### 1.0.0 + +- Initial release + +### 1.0.1 + +- Correctly return error description ([PR #2](https://github.com/smolblog/oauth2-twitter/pull/2)) diff --git a/README.md b/README.md index e399cc5..59b657e 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,8 @@ if (!isset($_GET['code'])) { // Try to get an access token (using the authorization code grant) $token = $provider->getAccessToken('authorization_code', [ - 'code' => $_GET['code'], - 'code_verifier' => $_SESSION['oauth2verifier'], + 'code' => $_GET['code'], + 'code_verifier' => $_SESSION['oauth2verifier'], ]); // Optional: Now you have a token you can look up a users profile data @@ -97,8 +97,8 @@ if (!isset($_GET['code'])) { print_r($e); echo ''; - // Failed to get user details - exit('Oh dear...'); + // Failed to get user details + exit('Oh dear...'); } // Use this to interact with an API on the users behalf @@ -106,6 +106,10 @@ if (!isset($_GET['code'])) { } ``` +## Changelog + +See `CHANGELOG.md` + ## Credits - [Evan Hildreth](https://github.com/oddevan) diff --git a/src/Twitter.php b/src/Twitter.php index 0ee7380..aa6a7e5 100644 --- a/src/Twitter.php +++ b/src/Twitter.php @@ -158,7 +158,7 @@ protected function checkResponse(ResponseInterface $response, $data): void return; } - $error = $data['description'] ?? ''; + $error = $data['error_description'] ?? ''; $code = $data['code'] ?? $response->getStatusCode(); throw new IdentityProviderException($error, $code, $data);