Skip to content

Commit

Permalink
fix: don't create loop with new middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
simonknittel committed Dec 25, 2024
1 parent ca6fe6b commit 20edfb7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/src/_middleware.ts → app/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export function middleware(request: NextRequest) {
// Early return. Make sure to use `authenticatePage()` on individual pages in order to fully authenticate the user.
if (pathname.startsWith("/app") && !sessionCookie) {
return NextResponse.redirect(new URL(`/`, request.url));
} else if (pathname === "/" && sessionCookie) {
return NextResponse.redirect(new URL(`/app`, request.url));
}

return NextResponse.next();
Expand Down

0 comments on commit 20edfb7

Please sign in to comment.