auth
auth copied to clipboard
"Undefined index: emails" in Microsoft provider when email is not requested
Hey!
Issue
I have my scope set to ['wl.basic'] because I don't need to get the user's email. This causes an exception to be thrown:
Uncaught PHP Exception ErrorException: "Notice: Undefined index: emails" at .../vendor/socialconnect/auth/src/OAuth2/Provider/Microsoft.php line 68
Adding 'wl.emails' to the scope makes it go away, but I don't need email. Instead, replacing $response['emails'] on line 68 with isset($response['emails']) would fix the issue altogether.
My env
PHP: 7.4.14
Library: socialconnect/auth 3.2.2
Provider: Microsoft
Provider options:
[
'options' => []
];
Thanks :smiley_cat: