summaryrefslogtreecommitdiff
path: root/src/components/auth/WithAuth.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/auth/WithAuth.js')
-rw-r--r--src/components/auth/WithAuth.js20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/components/auth/WithAuth.js b/src/components/auth/WithAuth.js
deleted file mode 100644
index ef975873..00000000
--- a/src/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