import { type NextRequest, NextResponse } from "next/server"; import { authMiddleware } from "~/middlewares/auth_middleware"; export async function middleware(request: NextRequest) { //console.log("Middleware triggered for:", request.nextUrl.pathname); return (await authMiddleware(request)) ?? NextResponse.next(); } export const config = { matcher: [ { source: "/", }, { missing: [ { key: "next-router-prefetch", type: "header" }, { key: "purpose", type: "header", value: "prefetch" }, ], source: "/((?!api/trpc|go-api/images|api/tiles|api/auth|_next/static|_next/image|screenshots|site.webmanifest|favicon.ico|favicon|sitemap.xml|robots.txt).*)", }, ], };