diff --git a/CHANGELOG.md b/CHANGELOG.md index 6873321..8e69423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,11 @@ - Fix an error with URL generation for authenticated requests. - Fix error handling for IdentityServer4 provider. +## 1.0.31 - 2024-08-27 + +### Fixed +- Add conditional for Twitter `code_verifier` check to prevent errors when already supplied. + ## 1.0.30 - 2024-08-09 ### Fixed diff --git a/src/providers/Twitter.php b/src/providers/Twitter.php index 8db6f6d..92b031a 100644 --- a/src/providers/Twitter.php +++ b/src/providers/Twitter.php @@ -42,7 +42,9 @@ protected function getAuthorizationQuery(array $params): string protected function getAccessTokenRequest(array $params): RequestInterface { // Apply PKCE token - $params['code_verifier'] = Session::get('oauth2verifier'); + if (!isset($params['code_verifier'])) { + $params['code_verifier'] = Session::get('oauth2verifier'); + } return parent::getAccessTokenRequest($params); }