diff --git a/src/middleware.ts b/src/proxy.ts similarity index 84% rename from src/middleware.ts rename to src/proxy.ts index c7618f1..4fe4f84 100644 --- a/src/middleware.ts +++ b/src/proxy.ts @@ -1,14 +1,10 @@ -// Next.js middleware — authentication gate -// Redirects unauthenticated users to login for protected routes. -// Runs at the edge before the page/api handler. - import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; import { getToken } from 'next-auth/jwt'; const PUBLIC_PATHS = new Set(['/', '/login', '/register']); -export async function middleware(request: NextRequest) { +export async function proxy(request: NextRequest) { const { pathname } = request.nextUrl; // Allow public paths, NextAuth API, and static assets