Commit 18d1aa84 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Déconnexion forcée lorsqu'on redirige vers la page Vous n'êtes pas autorisé à utiliser l'appli

parent efba00bc
Loading
Loading
Loading
Loading
+5
Changes for module/Application/src/Application/Controller/IndexController.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,11 @@ class IndexController extends AbstractController


        if ($this->identity() && count($this->userContextService->getSelectableIdentityRoles()) === 0) {
            // déconnexion applicative
            $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
            $this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
            $this->zfcUserAuthentication()->getAuthService()->clearIdentity();

            return $this->redirect()->toRoute('not-allowed');
        }