mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-29 22:29:57 +00:00
Applied styleci changes
This commit is contained in:
parent
fe07cdaa06
commit
129f3286d9
1 changed files with 6 additions and 1 deletions
|
@ -88,6 +88,7 @@ class Saml2Controller extends Controller
|
||||||
|
|
||||||
if (empty($samlResponse)) {
|
if (empty($samlResponse)) {
|
||||||
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
||||||
|
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,19 +109,23 @@ class Saml2Controller extends Controller
|
||||||
$acsId = $request->get('id', null);
|
$acsId = $request->get('id', null);
|
||||||
$cacheKey = 'saml2_acs:' . $acsId;
|
$cacheKey = 'saml2_acs:' . $acsId;
|
||||||
$samlResponse = null;
|
$samlResponse = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$samlResponse = decrypt(cache()->pull($cacheKey));
|
$samlResponse = decrypt(cache()->pull($cacheKey));
|
||||||
} catch (\Exception $exception) {}
|
} catch (\Exception $exception) {
|
||||||
|
}
|
||||||
$requestId = session()->pull('saml2_request_id', 'unset');
|
$requestId = session()->pull('saml2_request_id', 'unset');
|
||||||
|
|
||||||
if (empty($acsId) || empty($samlResponse)) {
|
if (empty($acsId) || empty($samlResponse)) {
|
||||||
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
||||||
|
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->samlService->processAcsResponse($requestId, $samlResponse);
|
$user = $this->samlService->processAcsResponse($requestId, $samlResponse);
|
||||||
if (is_null($user)) {
|
if (is_null($user)) {
|
||||||
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
|
||||||
|
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue