]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/Saml2Controller.php
Fixed occurances of altered titles in search results
[bookstack] / app / Http / Controllers / Auth / Saml2Controller.php
index 6a9071f9801331146436189b9c9b8400dc2fea9d..bd3b25da770ab113e04c2298b6d0b4d3f7b6f907 100644 (file)
@@ -37,7 +37,7 @@ class Saml2Controller extends Controller
      */
     public function logout()
     {
-        $logoutDetails = $this->samlService->logout();
+        $logoutDetails = $this->samlService->logout(auth()->user());
 
         if ($logoutDetails['id']) {
             session()->flash('saml2_logout_request_id', $logoutDetails['id']);
@@ -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');
         }