Skip to content

Commit

Permalink
Merge pull request #319 from saputradharma/v3-google-plus-api-closed
Browse files Browse the repository at this point in the history
Change Google+ APIs because it will be shutdown
  • Loading branch information
taylorotwell authored Dec 21, 2018
2 parents bc29c2b + b381b55 commit 79316f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Two/GoogleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function getTokenFields($code)
*/
protected function getUserByToken($token)
{
$response = $this->getHttpClient()->get('https://www.googleapis.com/plus/v1/people/me?', [
$response = $this->getHttpClient()->get('https://www.googleapis.com/userinfo/v2/me?', [
'query' => [
'prettyPrint' => 'false',
],
Expand All @@ -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' => Arr::get($user, 'name'),
'email' => Arr::get($user, 'email'),
'avatar' => $avatarUrl,
'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', $avatarUrl),
]);
Expand Down

0 comments on commit 79316f3

Please sign in to comment.