diff --git a/app/Access/Controllers/VATSIMConnectController.php b/app/Access/Controllers/VATSIMConnectController.php index 2abf9ce5bcc..002901dc424 100644 --- a/app/Access/Controllers/VATSIMConnectController.php +++ b/app/Access/Controllers/VATSIMConnectController.php @@ -1,19 +1,17 @@ where('email', $resourceOwner->data->personal->email)->exists()) { - //return redirect()->route('vatsim.authentication.connect.failed'); + return redirect()->route('vatsim.authentication.connect.failed'); } // All checks completed. Let's finally sign in the user @@ -185,20 +179,16 @@ protected function _completeLogin($resourceOwner, $accessToken) /** * Display a failed message and then return to the login * - * @param Request $request - * @return RedirectResponse */ public function failed(Request $request): RedirectResponse { - return redirect()->route('landing')->withErrors('Error logging in. Please try again.'); + return redirect('/')->withErrors('Error logging in. Please try again.'); } /** * End an authenticated session - * - * @return Redirect */ - public function logout() + public function logout(): RedirectResponse { Auth::logout(); diff --git a/routes/web.php b/routes/web.php index 283545a76f1..7b41918fb20 100644 --- a/routes/web.php +++ b/routes/web.php @@ -333,11 +333,9 @@ Route::prefix('authentication')->group(function () { Route::prefix('connect')->group(function () { - Route::get('login', [Auth\VATSIMConnectController::class, 'login'])->name('vatsim.authentication.connect.login'); - Route::get('logout', [Auth\VATSIMConnectController::class, 'logout'])->name('vatsim.authentication.connect.logout'); - Route::get('failed', function (\BookStack\Http\Request $request) { - return redirect('/'); - })->name('vatsim.authentication.connect.failed'); + Route::get('login', [AccessControllers\VATSIMConnectController::class, 'login'])->name('vatsim.authentication.connect.login'); + Route::get('logout', [AccessControllers\VATSIMConnectController::class, 'logout'])->name('vatsim.authentication.connect.logout'); + Route::get('failed', [AccessControllers\VATSIMConnectController::class, 'failed'])->name('vatsim.authentication.connect.failed'); }); });