src/Controller/AuthController.php line 31
<?phpnamespace App\Controller;use App\Repository\UserRepository;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;class AuthController extends AbstractController{/*#[Route('/login', name: 'app_login')]public function login(AuthenticationUtils $authenticationUtils): Response{$error = $authenticationUtils->getLastAuthenticationError();$lastUsername = $authenticationUtils->getLastUsername();return $this->render('@EasyAdmin/page/login.html.twig', ['last_username' => $lastUsername,'error' => $error,'csrf_token_intention' => 'authenticate','forgot_password_enabled' => true,]);}*/#[Route(path: '/login', name: 'login')]public function login(AuthenticationUtils $authenticationUtils): Response{if ($this->getUser()) {return $this->redirectToRoute('dashboard.my_incentives');}// get the login error if there is one$error = $authenticationUtils->getLastAuthenticationError();// last username entered by the user$lastUsername = $authenticationUtils->getLastUsername();return $this->render('/security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);}}