From 129f3286d9a57505898bfdf61f812cf0cddb0e4c Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 20 Oct 2021 13:40:27 +0100 Subject: [PATCH] Applied styleci changes --- app/Http/Controllers/Auth/Saml2Controller.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/Saml2Controller.php b/app/Http/Controllers/Auth/Saml2Controller.php index 6a9071f9801..871abf59f91 100644 --- a/app/Http/Controllers/Auth/Saml2Controller.php +++ b/app/Http/Controllers/Auth/Saml2Controller.php @@ -88,6 +88,7 @@ public function startAcs(Request $request) if (empty($samlResponse)) { $this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')])); + return redirect('/login'); } @@ -108,19 +109,23 @@ public function processAcs(Request $request) $acsId = $request->get('id', null); $cacheKey = 'saml2_acs:' . $acsId; $samlResponse = null; + try { $samlResponse = decrypt(cache()->pull($cacheKey)); - } catch (\Exception $exception) {} + } catch (\Exception $exception) { + } $requestId = session()->pull('saml2_request_id', 'unset'); if (empty($acsId) || empty($samlResponse)) { $this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')])); + return redirect('/login'); } $user = $this->samlService->processAcsResponse($requestId, $samlResponse); if (is_null($user)) { $this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')])); + return redirect('/login'); }