Skip to content

Commit

Permalink
Testing Rate Limiting for add to cart API.
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed Apr 2, 2024
1 parent a91a556 commit ebac9f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/cart/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function POST(request: Request) {
);
}

const { success } = await apiRatelimit?.limit(user.id);
const { success } = await apiRatelimit?.limit(user.id ?? "");

if (!success && process.env.VERCEL_ENV === "production") {
return new NextResponse("Too Many Requests! try again in 1 min", {
Expand Down

0 comments on commit ebac9f8

Please sign in to comment.