Commit e868dc56 authored by Ad Schellevis's avatar Ad Schellevis

(auth, legacy) proper error handling

parent b4dc3688
......@@ -727,5 +727,10 @@ function authenticate_user($username, $password, $authcfg = NULL) {
$authFactory = new OPNsense\Auth\AuthenticationFactory;
$authenticator = $authFactory->get($authName);
return $authenticator->authenticate($username, $password) ;
if ($authenticator != null) {
return $authenticator->authenticate($username, $password) ;
} else {
log_error('Unable to retrieve authenticator for '. $authName);
return false;
}
}
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