From a54bbdb90295d395221ab49f51ca3dc95ff7bb7a Mon Sep 17 00:00:00 2001 From: "p.hollmann" <31701319+paulhollmann@users.noreply.github.com> Date: Sat, 22 Jun 2024 21:34:03 +0200 Subject: [PATCH] Update ConnectController.php --- app/Access/Controllers/ConnectController.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/Access/Controllers/ConnectController.php b/app/Access/Controllers/ConnectController.php index 9e3b734f72d..b32cff3b6fb 100644 --- a/app/Access/Controllers/ConnectController.php +++ b/app/Access/Controllers/ConnectController.php @@ -39,18 +39,9 @@ public function login(Request $request) // Initiation state is without 'code' and 'state' if (!$request->has('code') || !$request->has('state')) { try { - // Initiate the authentication process using VATSIM Connect - // 1. Test if the service is available at all. - // 2. If available: Prepare the authentication url and send the user away to it - $response = \Illuminate\Support\Facades\Http::timeout(30)->get(config('vatsim.authentication.connect.base')); - if ($response->status() < 500 || $response->status() > 599) { - $authenticationUrl = $this->provider->getAuthorizationUrl(); - $request->session()->put('authentication.connect.state', $this->provider->getState()); - return redirect()->away($authenticationUrl); - } else { - // Send the user to the service unavailable page - return redirect('/')->withErrors('Connect error'); - } + $authenticationUrl = $this->provider->getAuthorizationUrl(); + $request->session()->put('authentication.connect.state', $this->provider->getState()); + return redirect()->away($authenticationUrl); } catch (\Illuminate\Http\Client\ConnectionException $ce) { // Send the user to the service unavailable page return redirect('/')->withErrors('Connect error');