oc-shopaholic / oc-buddies-plugin

👥 October CMS user system
https://octobercms.com/plugin/lovata-buddies
GNU General Public License v3.0
31 stars 15 forks source link

Bug with vkontakte authorization #34

Closed definer closed 5 years ago

definer commented 5 years ago

Hi, I see a bug when logging in to VKontakte

When logging in to VKontakte, Buddies does not see the received email and assigns a fake email

kharanenka commented 5 years ago

Hi! For VK, email does not always return from API.

definer commented 5 years ago

Certainly, but on my project an email address is open, and the mailing address is sent to the accessTokenResponseBody object, but not to the email field

kharanenka commented 5 years ago

You can debug plugins/lovata/buddies/components/SocialiteLogin.php component, login(), findUserByEmail() methods. We get email from Socialite packeage. You can debug socialite user object in line:

//line 96
$obUserData = \Laravel\Socialite\Facades\Socialite::driver($sDriverCode)->user();

You can check user email in line:

//line 158
$sEmail = $obUserData->getEmail();