X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/bba7dcce49394f478bd401486a2d8cba23ff79ac..refs/pull/5313/head:/app/Access/LoginService.php diff --git a/app/Access/LoginService.php b/app/Access/LoginService.php index f0f6ad4d3..cc48e0f9b 100644 --- a/app/Access/LoginService.php +++ b/app/Access/LoginService.php @@ -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']); } }