Commit 192b6eb6 authored by Ad Schellevis's avatar Ad Schellevis

(captiveportal, new) failsafe, don't try to authenticate if handler not found

parent 196da2bb
......@@ -141,15 +141,17 @@ class AccessController extends ApiControllerBase
$authFactory = new AuthenticationFactory();
foreach (explode(',', (string)$cpZone->authservers) as $authServerName) {
$authServer = $authFactory->get(trim($authServerName));
// try this auth method
$isAuthenticated = $authServer->authenticate(
$userName,
$this->request->getPost("password", "string")
);
if ($authServer != null) {
// try this auth method
$isAuthenticated = $authServer->authenticate(
$userName,
$this->request->getPost("password", "string")
);
if ($isAuthenticated) {
// stop trying, when authenticated
break;
if ($isAuthenticated) {
// stop trying, when authenticated
break;
}
}
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment