improvement: moved user data from localstorage to context

This commit is contained in:
canove
2021-01-13 08:08:25 -03:00
parent 2bec877e4f
commit 3aa287d394
23 changed files with 231 additions and 134 deletions

View File

@@ -5,11 +5,11 @@ import useAuth from "./useAuth";
const AuthContext = createContext();
const AuthProvider = ({ children }) => {
const { isAuth, loading, handleLogin, handleLogout } = useAuth();
const { loading, user, isAuth, handleLogin, handleLogout } = useAuth();
return (
<AuthContext.Provider
value={{ loading, isAuth, handleLogin, handleLogout }}
value={{ loading, user, isAuth, handleLogin, handleLogout }}
>
{children}
</AuthContext.Provider>