Skip to content

Commit

Permalink
Applied styleci changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddanbrown committed Oct 20, 2021
1 parent fe07cda commit 129f328
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Http/Controllers/Auth/Saml2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand Down

0 comments on commit 129f328

Please sign in to comment.