Skip to content

Commit

Permalink
[#39] Fix: 코드 가독성 완화
Browse files Browse the repository at this point in the history
  • Loading branch information
LDH98 committed Jun 1, 2024
1 parent 443e7ba commit 7cf4bc8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export default function middleware(request: NextRequest) {
// /start-family 페이지로 접근하는데 token이 없을 경우 : 리다이렉션
// /start-family 페이지로 접근하는데 token이 없지만 쿠키가 있을 경우 : 페이지 접근
// 추후 배포됐을 때 수정.
if (path === '/start-family' && hasQuery) {
return NextResponse.next();
} else if (path === '/start-family' && !hasQuery) {
if (hasCookie) {
if (path === '/start-family') {
if (hasQuery || hasCookie) {
return NextResponse.next();
} else {
return NextResponse.redirect(new URL('/login', request.nextUrl));
Expand Down

0 comments on commit 7cf4bc8

Please sign in to comment.