Skip to content

Commit

Permalink
🚑 [hotfix] : 로그인 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
nayoung3669 committed Jun 16, 2024
1 parent 55c10b8 commit 681920a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/app/(route)/page.tsx
Original file line number Diff line number Diff line change
@@ -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 <main></main>
const accessToken = getCookie('accessToken')
const refreshToken = getCookie('refreshToken')

if ((accessToken || refreshToken) !== undefined) {
route.push('/main')
} else {
route.push('/login')
}
// throw Error 서비스 종료 시 코드
}, [route])
return (
<main>
<Loading />
</main>
)
}

0 comments on commit 681920a

Please sign in to comment.