Middleware fix again
This commit is contained in:
parent
eed9798c02
commit
d1237d3b47
1 changed files with 2 additions and 2 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue