use fetchWrapper for getUser.js

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-01-28 15:29:51 +01:00
parent fc233d1498
commit a0bba2deb4
2 changed files with 6 additions and 22 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ export function AuthProvider({ children }) {
useEffect(() => {
(async () => {
const u = await getUser();
setUser(u);
setUser(u.data);
setLoading(false);
})();
}, []);
@@ -20,7 +20,7 @@ export function AuthProvider({ children }) {
const login = async (email, password) => {
const res = await loginFunction(email, password);
const u = res.status === 200 ? await getUser() : null;
if (u) setUser(u);
if (u) setUser(u.data);
return res;
};
@@ -32,7 +32,7 @@ export function AuthProvider({ children }) {
const update = async () => {
const u = await getUser();
setUser(u);
setUser(u.data);
}
return (