diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d8c503c..bccabad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Release Notes -## [Unreleased](https://github.com/laravel/socialite/compare/v5.18.0...5.x) +## [Unreleased](https://github.com/laravel/socialite/compare/v5.19.0...5.x) + +## [v5.19.0](https://github.com/laravel/socialite/compare/v5.18.0...v5.19.0) - 2025-03-27 + +* docs: sync readme with recent adapters by [@iBotPeaches](https://github.com/iBotPeaches) in https://github.com/laravel/socialite/pull/735 +* [5.x] Throw exception if config is incomplete by [@mateusjatenee](https://github.com/mateusjatenee) in https://github.com/laravel/socialite/pull/736 +* Supports PHPStan 1.12 by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/socialite/pull/739 ## [v5.18.0](https://github.com/laravel/socialite/compare/v5.17.1...v5.18.0) - 2025-02-11 diff --git a/art/logo.svg b/art/logo.svg index 0a5c2b58..5c05cb7d 100644 --- a/art/logo.svg +++ b/art/logo.svg @@ -1,14 +1,24 @@ - + - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Two/XProvider.php b/src/Two/XProvider.php index 8a1d5da7..57f8c67d 100644 --- a/src/Two/XProvider.php +++ b/src/Two/XProvider.php @@ -30,9 +30,21 @@ protected function getUserByToken($token) { $response = $this->getHttpClient()->get('https://api.x.com/2/users/me', [ RequestOptions::HEADERS => ['Authorization' => 'Bearer '.$token], - RequestOptions::QUERY => ['user.fields' => 'profile_image_url'], + RequestOptions::QUERY => ['user.fields' => 'profile_image_url,confirmed_email'], ]); return Arr::get(json_decode($response->getBody(), true), 'data'); } + + /** + * {@inheritdoc} + */ + protected function mapUserToObject(array $user) + { + $user = parent::mapUserToObject($user); + + $user->email = $user['confirmed_email']; + + return $user; + } }