From 9cd3190b53235e600f89be5ccdeac0b0139e739f Mon Sep 17 00:00:00 2001 From: rudy Date: Fri, 6 Jan 2023 14:31:43 +0100 Subject: [PATCH] baseUrl: utilisation baseUrl en cas de failure --- src/Security/SQLLoginUserAuthenticator.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Security/SQLLoginUserAuthenticator.php b/src/Security/SQLLoginUserAuthenticator.php index 4d78115..80384fa 100644 --- a/src/Security/SQLLoginUserAuthenticator.php +++ b/src/Security/SQLLoginUserAuthenticator.php @@ -10,7 +10,6 @@ use PDOException; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Security; @@ -29,14 +28,12 @@ class SQLLoginUserAuthenticator extends AbstractAuthenticator protected string $baseUrl; private SQLLoginService $sqlLoginService; - private UrlGeneratorInterface $router; private PasswordEncoder $passwordHasher; - public function __construct(string $baseUrl, SQLLoginService $sqlLoginService, UrlGeneratorInterface $router, PasswordEncoder $passwordHasher) + public function __construct(string $baseUrl, SQLLoginService $sqlLoginService, PasswordEncoder $passwordHasher) { $this->baseUrl = $baseUrl; $this->sqlLoginService = $sqlLoginService; - $this->router = $router; $this->passwordHasher = $passwordHasher; } @@ -59,9 +56,7 @@ class SQLLoginUserAuthenticator extends AbstractAuthenticator { $request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception); - return new RedirectResponse( - $this->router->generate('app_login') - ); + return new RedirectResponse($this->baseUrl.'/connect/login-accept'); } public function authenticate(Request $request): Passport -- 2.17.1