From 35ad046fe13409ab6a43d7e03c6b1a1d93e6967a Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Thu, 13 Jun 2024 12:10:22 +0200 Subject: [PATCH] Deleting acount --- src/Controller/ProfilController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/ProfilController.php b/src/Controller/ProfilController.php index 1df6d25..9e94137 100644 --- a/src/Controller/ProfilController.php +++ b/src/Controller/ProfilController.php @@ -146,10 +146,10 @@ class ProfilController extends AbstractController if ($this->getUser()->getId() === $profil->getId()) { - - $this->getUser()->eraseCredentials(); - //$this->mgr->remove($profil); - //$this->mgr->flush(); + $this->container->get('security.token_storage')->setToken(null); + //$this->getUser()->eraseCredentials(); + $this->mgr->remove($profil); + $this->mgr->flush(); return $this->redirectToRoute('app_logout'); }