Skip to content

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