laravel sociallite in boilerplate

156 views Asked by At

I have used laravel boilerplate for login. I have worked using virtual host and put information on basis of virtualhost.

I have 2 tables:

 1. users
 2. social_logins

Actually i am authenticating from users table. I need to store information in users and then link it with social_logins user_id i.e, store information in table 2.

The main problem here is it doesn't store data in table. This line is not working:

return $this->getAuthorizationFirst($provider); 

I have put redirect so it will redirect to given route but doesn't store data in database.

if I catch callback in controller I can catch the information.

 $user = Socialite::driver('facebook')->user();

I have done normally using Socialite plugin in normal laravel, but i don't have any idea in Boilerplate.

1

There are 1 answers

0
AddWeb Solution Pvt Ltd On

Actual lifecycle of this loginThirdParty trait is:
1 The first time this is hit, request is empty
2 It's redirected to the provider and then back here, where request is populated
3 So it then continues creating the user

So If the provider is not an acceptable, this trait kick back. Hopefully you need to recheck your .env for FACEBOOK_CLIENT_ID, FACEBOOK_CLIENT_SECRET and CALLBACK_URL.