← Back to Social Login Support
I updated the system of Octobercms. Then it came up with this error on both web page and the backend page. How could I solve it ? It seems like I am stuck on the frontend and backend and can only go to the text editor to solve it. I tried the steps in stackflow. But none works.
I have exactly the same error when first installing the plugin. This broke my page and i have no idea how to fix it.
One of the developers shared to remove the plugin then re-install it. You can choose to delete the folder manually. Or you can use php artisan plugin:remove Flynsarmy.SocialLogin in command prompt. I tried command prompt but it didn't work for me so I manually deleted the folder. My pages got back.
You need running the following command in root folder to resolve that problem: composer require laravel/socialite 2.*
Run the command 2 times, the first it cleans, the second install again, and everything works!
I simply used this Laravel socialite command to install it:
composer require laravel/socialite
It worked for me. There was no issue with me. Check whether you have configured the controllers and route correctly for socialite in Laravel.
/**
* Handle Social login request
*
* @return response
*/
public function socialLogin($social)
{
return Socialite::driver($social)->redirect();
}
/**
* Obtain the user information from Social Logged in.
* @param $social
* @return Response
*/
public function handleProviderCallback($social)
{
$userSocial = Socialite::driver($social)->user();
$user = User::where(['email' => $userSocial->getEmail()])->first();
if($user){
Auth::login($user);
return redirect()->action('HomeController@index');
}else{
return view('auth.register',['name' => $userSocial->getName(), 'email' => $userSocial->getEmail()]);
}
}
Route::get('/login/{social}','Auth\LoginController@socialLogin')->where('social','twitter|facebook|linkedin|google|github|bitbucket');
Route::get('/login/{social}/callback','Auth\LoginController@handleProviderCallback')->where('social','twitter|facebook|linkedin|google|github|bitbucket');
Here is what my controller and route looks like
1-9 of 9