baseUrl: modification pour la construction de l'url après acces, utilsation de baseUrl
Cadoles/hydra-sql/pipeline/pr-develop This commit looks good Details
Cadoles/hydra-sql/pipeline/head This commit looks good Details

This commit is contained in:
Rudy Masson 2023-01-06 14:02:20 +01:00
parent 84b72ccf18
commit a21bff82bc
2 changed files with 8 additions and 2 deletions

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)