Commit 27b665a3 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

AppStorage: vérification très tôt que l'établissement correspondant au domaine...

AppStorage: vérification très tôt que l'établissement correspondant au domaine référencé dans les données d'authentification existe en base.
parent 5da5e5a7
Loading
Loading
Loading
Loading
Loading
+9
Changes for module/Application/src/Application/Authentication/Storage/AppStorage.php: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -51,6 +51,15 @@ class AppStorage implements ChainableStorage
            return;
        }

        // pas la peine d'aller plus loin si l'établissement correspondant au domaine n'existe pas
        $domaineEtab = $this->userWrapper->getDomainFromEppn();
        $etablissement = $this->getEtablissementService()->getRepository()->findOneByDomaine($domaineEtab);
        if (! $etablissement) {
            throw new RuntimeException(
                "Les données concernant l'utilisateur authentifié font référence au domaine '$domaineEtab' " .
                "mais aucun établissement n'a été trouvé avec ce domaine.");
        }

        /**
         * Collecte des données issues de la table Utilisateur.
         */