From d336735a91133cc3f1cf6f67ba2ac29f0985fd2e Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 2 Mar 2023 16:51:05 +0700 Subject: delete src2 --- src2/components/auth/WithAuth.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src2/components/auth/WithAuth.js (limited to 'src2/components/auth/WithAuth.js') diff --git a/src2/components/auth/WithAuth.js b/src2/components/auth/WithAuth.js deleted file mode 100644 index ef975873..00000000 --- a/src2/components/auth/WithAuth.js +++ /dev/null @@ -1,20 +0,0 @@ -import { getAuth } from "@/core/utils/auth"; -import { useRouter } from "next/router"; -import { useEffect, useState } from "react"; - -const WithAuth = ({ children }) => { - const router = useRouter(); - const [response, setResponse] = useState(<>); - - useEffect(() => { - if (!getAuth()) { - router.replace('/login'); - } else { - setResponse(children); - } - }, [children, router]); - - return response; -} - -export default WithAuth; \ No newline at end of file -- cgit v1.2.3