diff --git a/middleware.ts b/middleware.ts index 46028fd..cc76c8a 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,6 +1,6 @@ import { authMiddleware } from "@clerk/nextjs"; import { validateRequest } from "./app/_lib/unkey"; -import { NextResponse } from "next/server"; +import { NextRequest, NextResponse } from "next/server"; import { Ratelimit } from "@upstash/ratelimit"; import { Redis } from "@upstash/redis"; import { env } from "./env.mjs"; @@ -18,7 +18,7 @@ export default authMiddleware({ ignoredRoutes: ["/"], publicRoutes: ["/api/external/(.*)", "/api/webhooks/(.*)"], apiRoutes: ["/api/internal/(.*)"], - beforeAuth: async (req) => { + beforeAuth: async (req: NextRequest) => { const { success } = await rateLimit.limit(req.ip || ""); if (success) { if (req.nextUrl.pathname.includes("/api/external/private")) {