public function logout(Request $request)
    {
        $this->dispatch(PhraseaEvents::LOGOUT, new LogoutEvent($this->app));
        $this->getAuthenticator()->closeAccount();

        $this->app->addFlash('info', $this->app->trans('Vous etes maintenant deconnecte. A bientot.'));

        $response = $this->app->redirectPath('homepage', [
            'redirect' => $request->query->get("redirect")
        ]);

        $response->headers->clearCookie('persistent');
        $response->headers->clearCookie('last_act');

        return $response;
    }