diff --git a/src/app/create/series/page.tsx b/src/app/create/series/page.tsx index 0c17f5f7..630109fd 100644 --- a/src/app/create/series/page.tsx +++ b/src/app/create/series/page.tsx @@ -1,9 +1,10 @@ import SeriesForm from '@/components/create/series/SeriesForm'; import LayoutWrapper from '@/components/shared/LayoutWrapper'; import { checkUser } from '@/service/auth'; -import { ACCESS_TOKEN, REFRESH_TOKEN } from '@/utils/const'; +import { ACCESS_TOKEN, MAIN_PATH, REFRESH_TOKEN } from '@/utils/const'; import { Metadata } from 'next'; -import { cookies } from 'next/headers'; +import { cookies, headers } from 'next/headers'; +import { redirect } from 'next/navigation'; export const metadata: Metadata = { title: '시리즈 작성', @@ -11,6 +12,10 @@ export const metadata: Metadata = { }; export default async function CreateSeriesPage() { + const headersList = headers(); + const referer = headersList.get('referer'); + referer === null && redirect(MAIN_PATH); + const accessToken = cookies().get(ACCESS_TOKEN)?.value; const refreshToken = cookies().get(REFRESH_TOKEN)?.value; const cookie = `${ACCESS_TOKEN}=${accessToken}; ${REFRESH_TOKEN}=${refreshToken}`;