diff --git a/src/Two/FacebookProvider.php b/src/Two/FacebookProvider.php index 50d4d194..175d4f4b 100644 --- a/src/Two/FacebookProvider.php +++ b/src/Two/FacebookProvider.php @@ -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; }