In some cases, the mail value in the token is returning null. I modified the listener in my app to look at userPrincipalName and update the token in the database appropraitely. However, it looks like the MsGraph code is overwriting this:
//find record and add email - not required but useful none the less
$t = MsGraphToken::findOrFail($result->id);
$t->email = $me['mail'];
$t->save();
I'm using the following check in the listener. Can this be added into the MsGraph code so that $t->email is set correctly?
if ($event->token['info']['mail']===null) {
$email=$event->token['info']['userPrincipalName'];
} else {
$email=$event->token['info']['mail'];
}
In some cases, the mail value in the token is returning null. I modified the listener in my app to look at userPrincipalName and update the token in the database appropraitely. However, it looks like the MsGraph code is overwriting this:
I'm using the following check in the listener. Can this be added into the MsGraph code so that $t->email is set correctly?
if ($event->token['info']['mail']===null) { $email=$event->token['info']['userPrincipalName']; } else { $email=$event->token['info']['mail']; }