mirror of
https://github.com/cheveguerra/Whaticket.git
synced 2026-04-19 03:59:15 +00:00
Initial commit
This commit is contained in:
19
frontend/src/context/Auth/AuthContext.js
Normal file
19
frontend/src/context/Auth/AuthContext.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import React, { createContext } from "react";
|
||||
|
||||
import useAuth from "../../hooks/useAuth.js";
|
||||
|
||||
const AuthContext = createContext();
|
||||
|
||||
const AuthProvider = ({ children }) => {
|
||||
const { loading, user, isAuth, handleLogin, handleLogout } = useAuth();
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
value={{ loading, user, isAuth, handleLogin, handleLogout }}
|
||||
>
|
||||
{children}
|
||||
</AuthContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export { AuthContext, AuthProvider };
|
||||
Reference in New Issue
Block a user