Skip to content

Commit

Permalink
only append membership_info to userinfo if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tamw-wnet committed Sep 19, 2024
1 parent b497841 commit 153b9b1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions classes/class-pbs-passport-authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,16 @@ public function get_membership_from_access_token($access_token = '', $client_arg
// get the full membership info if available
$mvault_client = $this->get_mvault_client();
$mvaultinfo = $mvault_client->get_membership_by_uid($pid);
$login_provider='';
if (isset($userinfo["provider"])) {
$login_provider = $userinfo["provider"];
} else if (isset ($mvaultinfo["pbs_profile"]["email"])) {
$login_provider = $mvaultinfo["pbs_profile"]["login_provider"];
if (isset ($mvaultinfo["pbs_profile"]["email"])) {
$loginprovider = $mvaultinfo["pbs_profile"]["login_provider"];
if (isset($client_args['use_pmsso']) && ($client_args['use_pmsso'] == true)) {
if (isset($userinfo["provider"])) {
$loginprovider = $userinfo["provider"];
}
}
$mvaultinfo["pbs_profile"]["login_provider"] = $mvault_client->normalize_login_provider($loginprovider);
$userinfo["membership_info"] = $mvaultinfo;
}
$mvaultinfo["pbs_profile"]["login_provider"] = $mvault_client->normalize_login_provider($login_provider);
$userinfo["membership_info"] = $mvaultinfo;
return $userinfo;
}
}

0 comments on commit 153b9b1

Please sign in to comment.