baseUrl: modification pour la construction de l'url après acces, utilsation de baseUrl #4

Merged
rmasson merged 1 commits from baseUrl into develop 2023-01-06 14:05:20 +01:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit a21bff82bc - Show all commits

View File

@ -48,6 +48,10 @@ services:
arguments:
$baseUrl: '%base_url%'
App\Hydra\HydraService:
arguments:
$baseUrl: '%base_url%'
App\SQLLogin\SQLLoginRequest:
arguments:
$config: []

View File

@ -15,12 +15,14 @@ class HydraService extends AbstractController
public SessionInterface $session;
public Client $client;
public TokenStorageInterface $tokenStorage;
public string $baseUrl;
public function __construct(Client $client, SessionInterface $session, TokenStorageInterface $tokenStorage)
public function __construct(Client $client, SessionInterface $session, TokenStorageInterface $tokenStorage, string $baseUrl)
{
$this->session = $session;
$this->client = $client;
$this->tokenStorage = $tokenStorage;
$this->baseUrl = $baseUrl;
}
public function handleLoginRequest(Request $request)
@ -40,7 +42,7 @@ class HydraService extends AbstractController
// si le challenge est validé par hydra, on le stocke en session pour l'utiliser par la suite et on redirige vers une route interne protégée qui va déclencher l'identification FranceConnect
$this->session->set('challenge', $loginRequestInfo['challenge']);
return $this->redirectToRoute('app_login');
return new RedirectResponse($this->baseUrl.'/login');
}
public function handleConsentRequest(Request $request)