11 lines
306 B
JavaScript
11 lines
306 B
JavaScript
import useUser from "@/lib/app/hooks/useUser";
|
|
import WithAuthComponent from "@/core/components/Middleware/WithAuthComponent";
|
|
|
|
const WithAuthMiddleware = ({children}) => {
|
|
const {isAuth} = useUser();
|
|
|
|
return isAuth ? <>{children}</> : <WithAuthComponent />;
|
|
};
|
|
|
|
export default WithAuthMiddleware;
|