Skip to content

Commit

Permalink
Revert "Feat : 버젼 다운그레이드 / 미들웨어 적용 해제"
Browse files Browse the repository at this point in the history
  • Loading branch information
TaePoong719 authored Nov 16, 2023
1 parent c0a6d50 commit 4e5effd
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 185 deletions.
16 changes: 9 additions & 7 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { NextApiRequest } from 'next';
import { cookies } from 'next/headers';
import { NextResponse } from 'next/server';

export const middleware = () => {
// const cookieStore = cookies();
// const cookie = cookieStore.get('accessToken');
// if (cookie) {
return NextResponse.next();
// }
// return NextResponse.redirect(new URL('/login', request.url));
export const middleware = (request: NextApiRequest) => {
const cookieStore = cookies();
const cookie = cookieStore.get('accessToken');
if (cookie) {
return NextResponse.next();
}
return NextResponse.redirect(new URL('/login', request.url));
};

export const config = {
Expand Down
Loading

0 comments on commit 4e5effd

Please sign in to comment.