Use a symfony form for login form

This allows us to reuse the global form renderings
This commit is contained in:
Jan Böhmer
2026-03-07 00:46:34 +01:00
parent 30e3bc3153
commit 598cf3ed80
3 changed files with 101 additions and 42 deletions

View File

@@ -25,6 +25,7 @@ namespace App\Controller;
use App\Entity\UserSystem\User;
use App\Events\SecurityEvent;
use App\Events\SecurityEvents;
use App\Form\Security\LoginFormType;
use App\Services\UserSystem\PasswordResetManager;
use Doctrine\ORM\EntityManagerInterface;
use Gregwar\CaptchaBundle\Type\CaptchaType;
@@ -61,7 +62,12 @@ class SecurityController extends AbstractController
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
$form = $this->createForm(LoginFormType::class, [
'_username' => $lastUsername,
]);
return $this->render('security/login.html.twig', [
'form' => $form,
'last_username' => $lastUsername,
'error' => $error,
]);