diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Logout.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Logout.js
index 8acb813..332ef2b 100644
--- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Logout.js
+++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Logout.js
@@ -1,30 +1,31 @@
import { useCookies } from "react-cookie";
-import { useNavigate } from "react-router-dom";
import { useEffect, useState } from "react";
const Logout = () => {
- const navigate = useNavigate();
const [cookies, setCookie, removeCookie] = useCookies(['name']);
const response = fetch(`https://localhost:7292/api/Logout`, {
- method: 'POST',
- credentials: 'include'
- })
+ method: 'POST',
+ credentials: 'include'
+ })
async function clear() {
await removeCookie("GMGM");
}
- useEffect(()=>{
- clear();
- navigate("/");
- });
+ useEffect(() => {
+ if (cookies.GMGM != null) {
+ clear();
+
+ window.location.reload();
+ }
+ }, []);
return (
-
Vous n'êtes plus connecté!
- Faites le party ou quelque-chose...
+ Vous n'êtes plus connecté!
+ Faites le party ou quelque-chose...
)
}