From 8eb79994dbec937611723ed21a987a7b4b4c1528 Mon Sep 17 00:00:00 2001 From: JimmyLv Date: Thu, 2 Mar 2023 22:06:00 +0800 Subject: [PATCH] fix: rename to shop --- middleware.ts | 4 ++-- pages/{blocked.tsx => shop.tsx} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename pages/{blocked.tsx => shop.tsx} (100%) diff --git a/middleware.ts b/middleware.ts index a704ba90..18e755d9 100644 --- a/middleware.ts +++ b/middleware.ts @@ -32,7 +32,7 @@ export async function middleware(req: NextRequest, ev: NextFetchEvent) { if (process.env.USER_LICENSE_KEYS?.includes(apiKey)) { const { remaining } = await ratelimit.limit(apiKey); if (remaining === 0) { - return NextResponse.redirect(new URL("/blocked", req.url)); + return NextResponse.redirect(new URL("/shop", req.url)); } } @@ -41,7 +41,7 @@ export async function middleware(req: NextRequest, ev: NextFetchEvent) { const { success, remaining } = await ratelimit.limit(identifier); console.log(`======== ip ${identifier}, remaining: ${remaining} ========`); if (!apiKey && !success) { - return NextResponse.redirect(new URL("/blocked", req.url)); + return NextResponse.redirect(new URL("/shop", req.url)); } } diff --git a/pages/blocked.tsx b/pages/shop.tsx similarity index 100% rename from pages/blocked.tsx rename to pages/shop.tsx