laravel-microsoft-graph icon indicating copy to clipboard operation
laravel-microsoft-graph copied to clipboard

Mail is null

Open rsf123 opened this issue 4 years ago • 0 comments

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']; }

rsf123 avatar Sep 21 '21 12:09 rsf123