X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c99a50de2c421a5a0c51b2e268c298717ff13019..refs/pull/711/head:/app/Services/SocialAuthService.php diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index ddcdc9ba6..02361e59b 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -1,5 +1,7 @@ validateDriver($socialDriver); - // Get user details from social driver $socialUser = $this->socialite->driver($driver)->user(); $socialId = $socialUser->getId(); @@ -135,7 +136,7 @@ class SocialAuthService $message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]); } - throw new SocialSignInException($message . '.', '/login'); + throw new SocialSignInException($message, '/login'); } /** @@ -149,8 +150,12 @@ class SocialAuthService { $driver = trim(strtolower($socialDriver)); - if (!in_array($driver, $this->validSocialDrivers)) abort(404, trans('errors.social_driver_not_found')); - if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured(trans('errors.social_driver_not_configured', ['socialAccount' => title_case($socialDriver)])); + if (!in_array($driver, $this->validSocialDrivers)) { + abort(404, trans('errors.social_driver_not_found')); + } + if (!$this->checkDriverConfigured($driver)) { + throw new SocialDriverNotConfigured(trans('errors.social_driver_not_configured', ['socialAccount' => title_case($socialDriver)])); + } return $driver; } @@ -219,5 +224,4 @@ class SocialAuthService session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)])); return redirect(user()->getEditUrl()); } - -} \ No newline at end of file +}