]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/SocialController.php
Quick run through of applying new test entity helper class
[bookstack] / app / Http / Controllers / Auth / SocialController.php
index dd567fe18b13843cce2ee97f0c342191199458da..9ba4028ec4e8fef924060a6d4c8b74bef59eee6b 100644 (file)
@@ -16,9 +16,9 @@ use Laravel\Socialite\Contracts\User as SocialUser;
 
 class SocialController extends Controller
 {
-    protected $socialAuthService;
-    protected $registrationService;
-    protected $loginService;
+    protected SocialAuthService $socialAuthService;
+    protected RegistrationService $registrationService;
+    protected LoginService $loginService;
 
     /**
      * SocialController constructor.
@@ -27,9 +27,8 @@ class SocialController extends Controller
         SocialAuthService $socialAuthService,
         RegistrationService $registrationService,
         LoginService $loginService
-    )
-    {
-        $this->middleware('guest')->only(['getRegister', 'postRegister']);
+    ) {
+        $this->middleware('guest')->only(['register']);
         $this->socialAuthService = $socialAuthService;
         $this->registrationService = $registrationService;
         $this->loginService = $loginService;
@@ -140,9 +139,9 @@ class SocialController extends Controller
         }
 
         $user = $this->registrationService->registerUser($userData, $socialAccount, $emailVerified);
+        $this->showSuccessNotification(trans('auth.register_success'));
         $this->loginService->login($user, $socialDriver);
 
-        $this->showSuccessNotification(trans('auth.register_success'));
         return redirect('/');
     }
 }