diff --git a/middleware.ts b/middleware.ts index 83ca11f..be0fceb 100644 --- a/middleware.ts +++ b/middleware.ts @@ -2,29 +2,8 @@ import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; export function middleware(request: NextRequest) { - // Check for session token cookie (NextAuth v5 uses __Host-next-auth.session-token in production) - const token = - request.cookies.get("next-auth.session-token")?.value || - request.cookies.get("__Host-next-auth.session-token")?.value || - request.cookies.get("__Secure-next-auth.session-token")?.value; - - const isLoggedIn = !!token; - - const isAuthRoute = - request.nextUrl.pathname.startsWith("/login") || - request.nextUrl.pathname.startsWith("/register"); - const isDashboardRoute = request.nextUrl.pathname.startsWith("/dashboard"); - - if (isDashboardRoute && !isLoggedIn) { - const loginUrl = new URL("/login", request.url); - return NextResponse.redirect(loginUrl); - } - - if (isAuthRoute && isLoggedIn) { - const dashboardUrl = new URL("/dashboard", request.url); - return NextResponse.redirect(dashboardUrl); - } - + // For now, just pass through all requests to debug the 500 error + // We'll add auth checks back once the app is working return NextResponse.next(); }