Merge pull request #27 from ViliusS/stop-propagation

Stop event propagation on empty username
This commit is contained in:
Andy Miller
2023-03-08 13:49:37 -07:00
committed by GitHub

View File

@@ -70,10 +70,11 @@ class LoginLDAPPlugin extends Plugin
public function userLoginAuthenticate(UserLoginEvent $event)
{
$credentials = $event->getCredentials();
// empty username -> ignore
// Fail early on empty username
if($credentials['username'] == ''){
$event->setStatus($event::AUTHENTICATION_FAILURE);
$event->stopPropagation();
return;
}