From 681920af7bbf95ef6dfaeadc91ad17e30e83e659 Mon Sep 17 00:00:00 2001 From: nayoung3669 Date: Sun, 16 Jun 2024 16:51:22 +0900 Subject: [PATCH] =?UTF-8?q?:ambulance:=20[hotfix]=20:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(route)/page.tsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/app/(route)/page.tsx b/src/app/(route)/page.tsx index 50ddbb1..e729c39 100644 --- a/src/app/(route)/page.tsx +++ b/src/app/(route)/page.tsx @@ -1,10 +1,27 @@ 'use client' +import Loading from '@/_components/common/Loading' + import { useEffect } from 'react' +import { getCookie } from '@/utils/cookieutils' +import { useRouter } from 'next/navigation' export default function Root() { + const route = useRouter() useEffect(() => { - throw Error // 서비스 종료 - }, []) - return
+ const accessToken = getCookie('accessToken') + const refreshToken = getCookie('refreshToken') + + if ((accessToken || refreshToken) !== undefined) { + route.push('/main') + } else { + route.push('/login') + } + // throw Error 서비스 종료 시 코드 + }, [route]) + return ( +
+ +
+ ) }