Fix redirect on login

This commit is contained in:
T'JAMPENS QUENTIN p2406187 committed 2025-11-15 23:43:06 +01:00
1 parent 840695cf90
commit 7705666c3b
2 files changed
+8 -11

No files matched your search

+3 -1
View File
@@ -17,9 +17,11 @@ export function AuthProvider({ children }) {
}, []);
const login = async (email, password) => {
await loginFunction(email, password);
const res = await loginFunction(email, password);
if (!res || res.status !== 200) throw new Error("Login error");
const u = await getUser();
setUser(u);
return res;
};
const logout = async () => {