]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/Saml2Controller.php
New translations validation.php (German Informal)
[bookstack] / app / Http / Controllers / Auth / Saml2Controller.php
index c32f19c5e50ba0728985fef1d270752bcb7ef26d..86389412861a033e6c9bc8170f8799cb3c23988a 100644 (file)
@@ -4,7 +4,6 @@ namespace BookStack\Http\Controllers\Auth;
 
 use BookStack\Auth\Access\Saml2Service;
 use BookStack\Http\Controllers\Controller;
-use Illuminate\Http\Request;
 
 class Saml2Controller extends Controller
 {
@@ -18,6 +17,15 @@ class Saml2Controller extends Controller
     {
         parent::__construct();
         $this->samlService = $samlService;
+
+        // SAML2 access middleware
+        $this->middleware(function ($request, $next) {
+            if (!config('saml2.enabled')) {
+                $this->showPermissionError();
+            }
+
+            return $next($request);
+        });
     }
 
     /**