Fix redirect on login
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user