SocialConnect/auth

PictureURL missing when using Google

enricalberola opened this issue · 3 comments

Hi!!

Issue

I'm using the library admad/cakephp-social-auth to authenticate users with Google id and I've noticed that this library is not storing each user's profile picture.

Looking for info about this error I found that you just fixed a similar issue related to the Steam provider (#117) and debugging it I noticed that adding the reference to this field in Google->getIdentity() fixed it.

diff --git a/src/OpenIDConnect/Provider/Google.php b/src/OpenIDConnect/Provider/Google.php
index f510ddd..99e2548 100644
--- a/src/OpenIDConnect/Provider/Google.php
+++ b/src/OpenIDConnect/Provider/Google.php
@@ -102,6 +102,7 @@ class Google extends AbstractProvider
             'email' => 'email',
             'verified_email' => 'emailVerified',
             'name' => 'fullname',
+            'picture' => 'pictureURL',
             'gender' => static function ($value, User $user) {
                 $user->setSex($value);
             },

If you want I can try to submit a PR. I've never dit it before, but I can try to do it.

My env

PHP:7.3.11
Library: cakephp-social-auth (cake-4.x)
Provider: admad


Thanks :smiley_cat:

plus. need to add

I was creted #125

ovr commented

Thanks @nepster-web for PR
Thanks @enricalberola for issue

Fix come in 3.1.7 release