Skip to content

Commit

Permalink
Merge pull request #316 from joshbrown/fix-google-response-object
Browse files Browse the repository at this point in the history
Fix mapping Google Userinfo to User Object
  • Loading branch information
driesvints authored Dec 20, 2018
2 parents ecc3ccf + 51d2a3c commit 73bbd8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Two/GoogleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ protected function getUserByToken($token)
*/
protected function mapUserToObject(array $user)
{
$avatarUrl = Arr::get($user, 'image.url');
$avatarUrl = Arr::get($user, 'picture');

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

0 comments on commit 73bbd8c

Please sign in to comment.