Merge pull request 'baseUrl: modification pour la construction de l'url après acces, utilsation de baseUrl' (#4) from baseUrl into develop
All checks were successful
Cadoles/hydra-sql/pipeline/head This commit looks good

Reviewed-on: #4
This commit is contained in:
Rudy Masson 2023-01-06 14:05:19 +01:00
commit 597485586c
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)