middleware.ts 664 B

12345678910111213141516171819202122232425262728
  1. import { NextRequest, NextResponse } from "next/server";
  2. export function middleware(request: NextRequest) {
  3. // Allow public routes
  4. const publicPaths = [
  5. "/",
  6. "/api-docs",
  7. "/api/auth/login",
  8. "/api/auth/register",
  9. "/api/auth/callback",
  10. "/api/auth/logout",
  11. ];
  12. const isPublicPath = publicPaths.some(path =>
  13. request.nextUrl.pathname.startsWith(path)
  14. );
  15. if (isPublicPath) {
  16. return NextResponse.next();
  17. }
  18. // For now, allow all other routes - we'll add proper authentication checks later
  19. return NextResponse.next();
  20. }
  21. export const config = {
  22. matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
  23. };