Replies: 1 comment 2 replies
-
Hey! Thank you for all of the additional information here! I will look into this and keep you posted! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As per the problem described in more detail on DevDojo, I have been trying to figure out what's preventing me from successfully make the social provider authentication functionality work. After digging deeper into the codebase, I ended up overriding the following:
vendor/devdojo/auth/src/Models/SocialProvider.php
,vendor/devdojo/auth/src/Models/SocialProviderUser.php
,vendor/devdojo/auth/src/Http/Controllers/SocialController.php
, andvendor/devdojo/auth/routes/web.php
.By debugging the private
createSocialProviderUser()
method of theSocialController.php
Controller, I realized the following:$user
object along with itsid
,name
,email
,avatar
,user
,token
, andexpiresIn
properties and their corresponding values from Facebook;$driver
parameter of thecreateSocialProviderUser()
method is correctly received asfacebook
;$user->socialProviders()->create()
call somehow fails, despite the fact that:'provider_slug' => $driver
// 'facebook''provider_user_id' => $socialiteUser->getId()
// '9002[...]40[...]'
'nickname' => $socialiteUser->getNickname()
// null
'name' => $socialiteUser->getName()
// 'John Doe'
'email' => $socialiteUser->getEmail()
// '[email protected]'
'avatar' => $socialiteUser->getAvatar()
// 'https://graph.facebook.com/v3.3/9002[...]40[...]/picture'
'provider_data'
// {"name":"John Doe","email":"[email protected]","id":"9002[...]40[...]"}
'token' => $socialiteUser->token
// 'EAAPoOafsNc4BOZBnOaV6fDf4nMrSeQn7[...]'
'refresh_token' => $socialiteUser->refreshToken
null
token_expires_at' => $socialiteUser->expiresIn ? now()->addSeconds($socialiteUser->expiresIn) : null
// 'Formatted: 2025-01-17 21:15:59 | Timezone: Europe/Copenhagen | Timestamp: 1737144959'
For some reason, the user doesn't get created, despite all the valid data as I mentioned above. Could one or both
null
values prevent the user from being persisted?That is where I got stuck. Any help will be greatly appreicated.
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions