Skip to content

Commit

Permalink
리다이렉트 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
YOOJS1205 committed Feb 10, 2024
1 parent 67b2190 commit d83c839
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Toaster } from 'sonner';

import './globals.css';

import AppleProvider from '@api/apple-config';
import AppleProvider from '@components/common/AppleProvider';
import QueryClientProviders from '@components/common/QueryClientProvider';
import WebViewContainer from '@components/common/WebViewContainer';

Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export function middleware(request: NextRequest) {

// NOTE: 메인 페이지 진입 시 토큰이 존재하지 않으면 로그인 페이지로 리다이렉트
if (request.nextUrl.pathname === '/') {
if (request.method === 'POST') {
return NextResponse.redirect(new URL('/', request.url), 303);
}

const cookieAccessToken = request.cookies.get('accessToken');
const cookieRefreshToken = request.cookies.get('refreshToken');

Expand Down

0 comments on commit d83c839

Please sign in to comment.