Skip to content

Commit

Permalink
Fix: create series 페이지 직접방문 차단
Browse files Browse the repository at this point in the history
  • Loading branch information
dongree committed Oct 22, 2023
1 parent 7a8c406 commit bd84487
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/create/series/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
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: '시리즈 작성',
description: '시리즈 작성하는 곳입니다.',
};

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}`;
Expand Down

0 comments on commit bd84487

Please sign in to comment.