From 529b80375f2d6e7133768a5cc66c4fff095bbc66 Mon Sep 17 00:00:00 2001 From: nox Date: Fri, 25 Oct 2019 20:46:05 +0200 Subject: [PATCH] Renvoi de la bonne config --- .gitignore | 3 ++- config/conf.php | 6 ++---- public/index.php | 3 ++- src/Auth/Action/LogoutAction.php | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index fdaab5d..03c4c38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ config/config.php -config/conf.php .idea /public/uploads /tmp +vendor +composer.json composer.lock \ No newline at end of file diff --git a/config/conf.php b/config/conf.php index b8c7df8..32e0b2d 100644 --- a/config/conf.php +++ b/config/conf.php @@ -1,7 +1,5 @@ addModule(AdminModule::class) diff --git a/src/Auth/Action/LogoutAction.php b/src/Auth/Action/LogoutAction.php index caa15f4..93b5f43 100644 --- a/src/Auth/Action/LogoutAction.php +++ b/src/Auth/Action/LogoutAction.php @@ -5,8 +5,13 @@ use App\Auth\DatabaseAuth; use Framework\Renderer\RendererInterface; use Framework\Response\RedirectResponse; use Framework\Session\FlashService; +use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; +/** + * Class LogoutAction + * @package App\Auth\Action + */ class LogoutAction { @@ -23,17 +28,22 @@ class LogoutAction */ private $flashService; - public function __construct(RendererInterface $renderer, DatabaseAuth $auth, FlashService $flashService) + private $container; + + public function __construct(RendererInterface $renderer, DatabaseAuth $auth, FlashService $flashService + , ContainerInterface $container) { $this->renderer = $renderer; $this->auth = $auth; $this->flashService = $flashService; + $this->container = $container; } public function __invoke(ServerRequestInterface $request) { + $gmarchePrefix = $this->container->get('gmarche.prefix'); $this->auth->logout(); $this->flashService->success('Vous êtes maintenant déconnecté'); - return new RedirectResponse('/gmarche'); + return new RedirectResponse("$gmarchePrefix"); } }