mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-06 19:17:27 +02:00
🔒️ Fix middleware logic
This commit is contained in:
parent
532410d76c
commit
b9cbb61afc
1 changed files with 10 additions and 13 deletions
|
@ -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,8 +32,6 @@ 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,
|
||||
|
@ -44,7 +41,7 @@ if (env.LICENSE_API_AUTH_TOKEN) {
|
|||
})
|
||||
: undefined,
|
||||
}),
|
||||
),
|
||||
bearerAuth({ token: env.LICENSE_API_AUTH_TOKEN }),
|
||||
async (c) => {
|
||||
const { type, seats, expiresAt, licenseeEmail, licenseeName, version } =
|
||||
c.req.valid("json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue