mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
(auth, legacy) proper error handling
This commit is contained in:
parent
b4dc36887d
commit
e868dc56d8
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user