Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in GoogleProvider between laravel/socialite:2.0.21 and laravel/socialite:2.0.22 #5

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

isreehari
Copy link

@isreehari isreehari commented Apr 1, 2019

There is breaking change in GoogleProvider between laravel/socialite:2.0.21 and laravel/socialite:2.0.22

https://github.com/laravel/socialite/releases/tag/v2.0.22

/**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        $avatarUrl = Arr::get($user, 'picture');

        return (new User)->setRaw($user)->map([
            'id' => Arr::get($user, 'id'),
            'nickname' => Arr::get($user, 'nickname'),
            'name' => Arr::get($user, 'name'),
            'email' => Arr::get($user, 'email'),
            'avatar' => $avatarUrl,
            'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', $avatarUrl),
        ]);
    }

https://github.com/laravel/socialite/releases/tag/v2.0.21

 /**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        return (new User)->setRaw($user)->map([
            'id' => $user['id'], 
            'nickname' => Arr::get($user, 'nickname'), 
            'name' => $user['displayName'],
            'email' => $user['emails'][0]['value'], 
            'avatar' => Arr::get($user, 'image')['url'],
            'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', Arr::get($user, 'image')['url']),
        ]);
    }

@isreehari
Copy link
Author

Think it would be better if we contact the laravel/socialite team to remove the 2.0.22 because it's breaking changes it should be major version release than the minor fix. Please suggest me it would be good idea. @leehicks or we will update our repo?

@wjgilmore
Copy link

Hi @isreehari I recommend getting in touch with the laravel/socialite team as it sounds like this is something they would need to address. There very well may be a discussion going on about this matter in their issue tracker?

@isreehari
Copy link
Author

Hi @wjgilmore it seems to me like we need just need to modify the GoogleProvider in our code because when I compare between 2.0.21 and 2.0.22 there is only one major difference in GoogleProvider file.

laravel/socialite@v2.0.21...laravel:v2.0.22

I already put a ticket there and we will see if someone get back to us - laravel/socialite#356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants