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

[5.x] Revert Facebook picture access token changes #504

Merged
merged 3 commits into from
Dec 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/Two/FacebookProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ protected function getUserByToken($token)
*/
protected function mapUserToObject(array $user)
{
$avatarUrl = $this->graphUrl.'/'.$this->version.'/'.$user['id'].'/picture?access_token='.$this->lastToken;
$avatarUrl = $this->graphUrl.'/'.$this->version.'/'.$user['id'].'/picture';

return (new User)->setRaw($user)->map([
'id' => $user['id'],
'nickname' => null,
'name' => $user['name'] ?? null,
'email' => $user['email'] ?? null,
'avatar' => $avatarUrl.'&type=normal',
'avatar_original' => $avatarUrl.'&width=1920',
'avatar' => $avatarUrl.'?type=normal',
'avatar_original' => $avatarUrl.'?width=1920',
'profileUrl' => $user['link'] ?? null,
]);
}
Expand Down Expand Up @@ -182,6 +182,16 @@ public function reRequest()
return $this;
}

/**
* Get the last access token used.
*
* @return string|null
*/
public function lastToken()
{
return $this->lastToken;
}

/**
* Specify which graph version should be used.
*
Expand Down