Skip to content

Commit

Permalink
Check if some fields exist using limited login
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicodeStudio authored Jun 27, 2024
1 parent d772c96 commit 961911e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Two/FacebookProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ 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 961911e

Please sign in to comment.