Add logout btn
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user