Corriger les dossiers animaux et le suivi médical
This commit is contained in:
parent
a55d27935f
commit
7b89fd5dfa
34 changed files with 440 additions and 39 deletions
|
|
@ -112,8 +112,19 @@ final class IcadService
|
|||
]);
|
||||
$this->assertSuccess($r2, t('service.icad.login_failed'));
|
||||
|
||||
// Le point d'entrée renvoie désormais du JSON et fournit l'adresse réelle
|
||||
// de l'espace connecté. L'ancienne URL fixe /pro répond en 404 depuis 2026.
|
||||
$loginResponse = json_decode(trim((string) $r2['body']), true);
|
||||
if (is_array($loginResponse) && trim((string) ($loginResponse['error'] ?? '')) !== '') {
|
||||
throw new RuntimeException(t('service.icad.login_failed'));
|
||||
}
|
||||
$accountPath = is_array($loginResponse) ? trim((string) ($loginResponse['address'] ?? '')) : '';
|
||||
if ($accountPath === '' || !str_starts_with($accountPath, '/')) {
|
||||
$accountPath = '/acteur';
|
||||
}
|
||||
|
||||
// 3) Vérif session
|
||||
$r2b = $this->req('https://www.i-cad.fr/pro', $cookie);
|
||||
$r2b = $this->req('https://www.i-cad.fr' . $accountPath, $cookie);
|
||||
$this->assertSuccess($r2b, t('service.icad.login_failed'));
|
||||
if (stripos($r2b['body'], 'Se connecter') !== false || str_contains((string)$r2b['effective_url'], '/login')) {
|
||||
throw new RuntimeException(t('service.icad.login_failed'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue