]> BookStack Code Mirror - bookstack/blobdiff - app/Access/LoginService.php
ExportFormatter: Add book description and check for empty book and chapter descriptio...
[bookstack] / app / Access / LoginService.php
index f0f6ad4d3a0500b3c4f68266006529a1e6179fc5..cc48e0f9babed3777b713f6fdf551f70e8603090 100644 (file)
@@ -176,14 +176,18 @@ class LoginService
     }
 
     /**
-     * Check if login auto-initiate should be valid based upon authentication config.
+     * Check if login auto-initiate should be active based upon authentication config.
      */
-    protected function shouldAutoInitiate(): bool
+    public function shouldAutoInitiate(): bool
     {
+        $autoRedirect = config('auth.auto_initiate');
+        if (!$autoRedirect) {
+            return false;
+        }
+
         $socialDrivers = $this->socialDriverManager->getActive();
         $authMethod = config('auth.method');
-        $autoRedirect = config('auth.auto_initiate');
 
-        return $autoRedirect && count($socialDrivers) === 0 && in_array($authMethod, ['oidc', 'saml2']);
+        return count($socialDrivers) === 0 && in_array($authMethod, ['oidc', 'saml2']);
     }
 }