Skip to content

Commit

Permalink
Check if some fields exist using limited login (#709)
Browse files Browse the repository at this point in the history
* Check if some fields exist using limited login

* Update FacebookProvider.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
CosmicodeStudio and taylorotwell authored Jun 28, 2024
1 parent d772c96 commit cc02625
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Two/FacebookProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ protected function getUserByOIDCToken($token)
throw_if($data['iss'] !== 'https://www.facebook.com', new Exception('Token has incorrect issuer.'));

$data['id'] = $data['sub'];
$data['first_name'] = $data['given_name'];
$data['last_name'] = $data['family_name'];

if (isset($data['given_name'])) {
$data['first_name'] = $data['given_name'];
}

if (isset($data['family_name'])) {
$data['last_name'] = $data['family_name'];
}

return $data;
}
Expand Down

0 comments on commit cc02625

Please sign in to comment.