diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 0de4a8282..c9d6a5496 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,6 +2,7 @@ namespace BookStack\Http\Controllers\Auth; +use BookStack\Exceptions\AuthException; use BookStack\Http\Controllers\Controller; use BookStack\Repos\UserRepo; use BookStack\Services\SocialAuthService; diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 6bba6de04..d9bb500b4 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -51,7 +51,7 @@ class RegisterController extends Controller */ public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo) { - $this->middleware('guest'); + $this->middleware('guest')->except(['socialCallback', 'detachSocialAccount']); $this->socialAuthService = $socialAuthService; $this->emailConfirmationService = $emailConfirmationService; $this->userRepo = $userRepo; @@ -297,5 +297,4 @@ class RegisterController extends Controller return $this->registerUser($userData, $socialAccount); } - } \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 28e6dccb1..d179c28a5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -153,7 +153,7 @@ Route::group(['middleware' => 'auth'], function () { }); // Social auth routes -Route::get('/login/service/{socialDriver}', 'Auth\RegisterController@getSocialLogin'); +Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin'); Route::get('/login/service/{socialDriver}/callback', 'Auth\RegisterController@socialCallback'); Route::get('/login/service/{socialDriver}/detach', 'Auth\RegisterController@detachSocialAccount'); Route::get('/register/service/{socialDriver}', 'Auth\RegisterController@socialRegister');