From f555d111be2ccec2555a64f6567ffe63afdc8bf9 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaury1729@users.noreply.github.com> Date: Fri, 29 Dec 2023 22:09:11 +0100 Subject: [PATCH] fix: Limit bulk to 100k emails --- src/app/[lang]/dashboard/Dashboard.tsx | 2 +- src/app/api/v1/bulk/route.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/[lang]/dashboard/Dashboard.tsx b/src/app/[lang]/dashboard/Dashboard.tsx index 3fe0bc89..09a07b9f 100644 --- a/src/app/[lang]/dashboard/Dashboard.tsx +++ b/src/app/[lang]/dashboard/Dashboard.tsx @@ -17,7 +17,7 @@ interface DashboardProps { export function Dashboard({ children, d, - showApiUsage, + showApiUsage = true, subscription, tab, }: DashboardProps) { diff --git a/src/app/api/v1/bulk/route.ts b/src/app/api/v1/bulk/route.ts index 67b8c291..da1b3c01 100644 --- a/src/app/api/v1/bulk/route.ts +++ b/src/app/api/v1/bulk/route.ts @@ -39,6 +39,16 @@ export const POST = async (req: NextRequest): Promise => { } const payload: BulkPayload = await req.json(); + if (payload.input.length > 100000) { + return Response.json( + { + error: "Bulk verification is limited to 100_000 emails", + }, + { + status: 403, + } + ); + } // Add to Supabase const res1 = await supabaseAdmin