From: Vincent Vanwaelscappel Date: Thu, 7 Oct 2021 19:06:30 +0000 (+0200) Subject: wip #4765 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6f799a903723a1dc545121f0df5dd6c3c11d945c;p=cubist_socialite.git wip #4765 --- diff --git a/src/Http/Controllers/SocialiteController.php b/src/Http/Controllers/SocialiteController.php index 689633a..4d57229 100644 --- a/src/Http/Controllers/SocialiteController.php +++ b/src/Http/Controllers/SocialiteController.php @@ -31,7 +31,14 @@ class SocialiteController extends Controller { $provider = request()->provider; if (in_array($provider, $this->providers)) { - dd(Socialite::driver($provider)->user()); + $socialiteUser = Socialite::driver('google')->user(); + if ($socialiteUser) { + $userClass = config('auth.providers.users.model'); + $instance = new $userClass(); + $instance->id = $socialiteUser->getId(); + $instance->email = $socialiteUser->getEmail(); + Auth::login($instance); + } } } } \ No newline at end of file