From: Vincent Vanwaelscappel Date: Thu, 7 Oct 2021 18:33:55 +0000 (+0200) Subject: wip #4765 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=571d10f4238e9aeeb50e64813e774c651b97f333;p=cubist_socialite.git wip #4765 --- diff --git a/src/CubistSocialiteAuthProvider.php b/src/CubistSocialiteAuthProvider.php deleted file mode 100644 index 56d51cf..0000000 --- a/src/CubistSocialiteAuthProvider.php +++ /dev/null @@ -1,31 +0,0 @@ -registerPolicies(); - - Auth::viaRequest('socialitegoogle', function (Request $request) { - $socialiteUser = Socialite::driver('google')->user(); - if ($socialiteUser) { - $userClass = config('auth.providers.users.model'); - $instance = new $userClass(); - $instance->id = $socialiteUser->getId(); - $instance->email = $socialiteUser->getEmail(); - } - }); - } -} \ No newline at end of file diff --git a/src/CubistSocialiteAuthServiceProvider.php b/src/CubistSocialiteAuthServiceProvider.php new file mode 100644 index 0000000..dd7668b --- /dev/null +++ b/src/CubistSocialiteAuthServiceProvider.php @@ -0,0 +1,31 @@ +registerPolicies(); + + Auth::viaRequest('socialitegoogle', function (Request $request) { + $socialiteUser = Socialite::driver('google')->user(); + if ($socialiteUser) { + $userClass = config('auth.providers.users.model'); + $instance = new $userClass(); + $instance->id = $socialiteUser->getId(); + $instance->email = $socialiteUser->getEmail(); + } + }); + } +} \ No newline at end of file