From: Dan Brown Date: Thu, 14 Sep 2017 19:20:47 +0000 (+0100) Subject: Updated social login to redirect to intended page. X-Git-Tag: v0.18.1~1^2~5 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/39e7ac1c1537fd0d4b5d6ff041a314a2fa659eca Updated social login to redirect to intended page. Closes #508. --- diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index 2c15e73ce..ddcdc9ba6 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -104,7 +104,8 @@ class SocialAuthService // When a user is not logged in and a matching SocialAccount exists, // Simply log the user into the application. if (!$isLoggedIn && $socialAccount !== null) { - return $this->logUserIn($socialAccount->user); + auth()->login($socialAccount->user); + return redirect()->intended('/'); } // When a user is logged in but the social account does not exist, @@ -137,13 +138,6 @@ class SocialAuthService throw new SocialSignInException($message . '.', '/login'); } - - private function logUserIn($user) - { - auth()->login($user); - return redirect('/'); - } - /** * Ensure the social driver is correct and supported. *