From b9cbb61afc7b7b0520ed756bd6ac00d09741cb7b Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Sun, 1 Jun 2025 10:59:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Fix=20middleware=20logi?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/api/licensing/v1/[...route]/route.ts | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/web/src/app/api/licensing/v1/[...route]/route.ts b/apps/web/src/app/api/licensing/v1/[...route]/route.ts index 3f1f518f2..ac47d883f 100644 --- a/apps/web/src/app/api/licensing/v1/[...route]/route.ts +++ b/apps/web/src/app/api/licensing/v1/[...route]/route.ts @@ -14,7 +14,6 @@ import { kv } from "@vercel/kv"; import { Hono } from "hono"; import { rateLimiter } from "hono-rate-limiter"; import { bearerAuth } from "hono/bearer-auth"; -import { some } from "hono/combine"; import { handle } from "hono/vercel"; const isKvAvailable = @@ -33,18 +32,16 @@ if (env.LICENSE_API_AUTH_TOKEN) { app.post( "/licenses", zValidator("json", createLicenseInputSchema), - some( - bearerAuth({ token: env.LICENSE_API_AUTH_TOKEN }), - rateLimiter({ - windowMs: 60 * 60 * 1000, - limit: 10, - store: isKvAvailable - ? new RedisStore({ - client: kv, - }) - : undefined, - }), - ), + rateLimiter({ + windowMs: 60 * 60 * 1000, + limit: 10, + store: isKvAvailable + ? new RedisStore({ + client: kv, + }) + : undefined, + }), + bearerAuth({ token: env.LICENSE_API_AUTH_TOKEN }), async (c) => { const { type, seats, expiresAt, licenseeEmail, licenseeName, version } = c.req.valid("json");