]> _ Git - cubist_socialite.git/commitdiff
wip #4765
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Oct 2021 18:33:55 +0000 (20:33 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Oct 2021 18:33:55 +0000 (20:33 +0200)
src/CubistSocialiteAuthProvider.php [deleted file]
src/CubistSocialiteAuthServiceProvider.php [new file with mode: 0644]

diff --git a/src/CubistSocialiteAuthProvider.php b/src/CubistSocialiteAuthProvider.php
deleted file mode 100644 (file)
index 56d51cf..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-namespace Cubist\Socialite;
-
-use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Auth;
-use Laravel\Socialite\Facades\Socialite;
-
-class CubistSocialiteAuthProvider extends AuthServiceProvider
-{
-    /**
-     * Register any application authentication / authorization services.
-     *
-     * @return void
-     */
-    public function boot()
-    {
-        $this->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 (file)
index 0000000..dd7668b
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Cubist\Socialite;
+
+use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
+use Laravel\Socialite\Facades\Socialite;
+
+class CubistSocialiteAuthServiceProvider extends AuthServiceProvider
+{
+    /**
+     * Register any application authentication / authorization services.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        $this->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