Skip to content

Commit

Permalink
Merge pull request #3 from affinidi/paramesh
Browse files Browse the repository at this point in the history
fix: updated token claims
  • Loading branch information
kamarthiparamesh authored Feb 2, 2024
2 parents 714aa11 + c56cb68 commit f8bed30
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/AffinidiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ function getUserProfile()
$userProfile = new User\Profile();
$userProfile->identifier = $collection->get('did');
$userProfile->email = $collection->get('email');
$userProfile->firstName = $collection->get('givenName');
$userProfile->lastName = $collection->get('familyName');
$userProfile->displayName = $collection->get('givenName') . ' ' . $collection->get('familyName');
$userProfile->firstName = $collection->get('givenName') ?: $collection->get('given_name');
$userProfile->lastName = $collection->get('familyName') ?: $collection->get('family_name');
$userProfile->displayName = $userProfile->firstName . ' ' . $userProfile->lastName;
$userProfile->profileURL = $collection->get('picture');
$userProfile->gender = $collection->get('gender');
$userProfile->phone = $collection->get('phoneNumber');
$userProfile->address = $collection->get('formatted');
$userProfile->country = $collection->get('country');
$userProfile->city = $collection->get('locality');
$userProfile->zip = $collection->get('postalCode');
$userProfile->phone = $collection->get('phoneNumber') ?: $collection->get('phone_number');
$userProfile->address = $collection->get('formatted') ?: $collection->filter('address')->get('formatted');
$userProfile->country = $collection->get('country') ?: $collection->filter('address')->get('country');
$userProfile->city = $collection->get('locality') ?: $collection->filter('address')->get('locality');
$userProfile->zip = $collection->get('postalCode') ?: $collection->filter('address')->get('postal_code');

return $userProfile;
}
Expand Down

0 comments on commit f8bed30

Please sign in to comment.