ref(frontend): fix file or disable eslint rules

This commit is contained in:
이강준
2022-11-26 18:20:02 +09:00
parent f2329884f8
commit 568042fac0
19 changed files with 186 additions and 120 deletions
+4 -3
View File
@@ -11,9 +11,11 @@ export default function RouteGuard({ children }) {
const router = useRouter();
const [authorized, setAuthorized] = useState(false);
useEffect(async () => {
useEffect(() => {
// on initial load - run auth check
await authCheck(router.asPath);
(async () => {
await authCheck(router.asPath);
})();
// on route change start - hide page content by setting authorized to false
// #TODO: add the loading page when not yet authorized.
@@ -31,7 +33,6 @@ export default function RouteGuard({ children }) {
router.events.off("routeChangeComplete", authCheck);
// router.events.off("routeChangeError", onError);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);