From: Dan Brown Date: Wed, 20 Oct 2021 12:40:27 +0000 (+0100) Subject: Applied styleci changes X-Git-Tag: v21.10~1^2~8 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/129f3286d9a57505898bfdf61f812cf0cddb0e4c?hp=--cc Applied styleci changes --- 129f3286d9a57505898bfdf61f812cf0cddb0e4c diff --git a/app/Http/Controllers/Auth/Saml2Controller.php b/app/Http/Controllers/Auth/Saml2Controller.php index 6a9071f98..871abf59f 100644 --- a/app/Http/Controllers/Auth/Saml2Controller.php +++ b/app/Http/Controllers/Auth/Saml2Controller.php @@ -88,6 +88,7 @@ class Saml2Controller extends Controller if (empty($samlResponse)) { $this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')])); + return redirect('/login'); } @@ -108,19 +109,23 @@ class Saml2Controller extends Controller $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'); }