Add logout btn

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2025-12-04 18:18:31 +01:00
parent 37e4968023
commit 22065fbd16
5 changed files with 48 additions and 7 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
import loginFunction from "../../utils/login.js";
import getUser from "../../utils/getUser.js";
import { AuthContext } from "./AuthContext";
import logoutFunction from "../../utils/auth/logout.js"
export function AuthProvider({ children }) {
@@ -25,7 +26,7 @@ export function AuthProvider({ children }) {
};
const logout = async () => {
// TODO: Appeller fonction logout
await logoutFunction();
setUser(null);
};