Fixed static analysis issue and added test for UserRepository

This commit is contained in:
Jan Böhmer 2023-08-01 16:20:31 +02:00
parent c981476706
commit b3153dac68
5 changed files with 117 additions and 3 deletions

View file

@ -170,7 +170,7 @@ class SecurityController extends AbstractController
$this->addFlash('success', 'pw_reset.new_pw.success');
$repo = $em->getRepository(User::class);
$u = $repo->findOneBy(['name' => $data['username']]);
$u = $repo->findByUsername($data['username']);
$event = new SecurityEvent($u);
/** @var EventDispatcher $eventDispatcher */
$eventDispatcher->dispatch($event, SecurityEvents::PASSWORD_RESET);