Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version

This commit is contained in:
Victor Turgeon
2022-11-06 13:15:39 -05:00
5 changed files with 49 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import { useCookies } from "react-cookie";
const Topbar = () => {
const [cookies, setCookie, removeCookie] = useCookies(['name']);
const [user, setLogin] = useState(null);
useEffect(() => {
async function reset() {
await setLogin(await cookies.GMGM ?? null);
@@ -22,9 +23,8 @@ const Topbar = () => {
method: 'POST',
credentials: 'include'
})
await removeCookie("GMGM");
await setLogin(null); // Y U NO WORK?!?
await removeCookie("GMGM");
await setLogin(null); // Y U NO WORK?!?
}
return (