Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove rate limit + remove dashboard html example

Steven Tey2986f1663120
diff --git a/apps/web/app/api/tokens/embed/route.ts b/apps/web/app/api/tokens/embed/route.ts
index d998128c38..a923cb1551 100644
--- a/apps/web/app/api/tokens/embed/route.ts
+++ b/apps/web/app/api/tokens/embed/route.ts
@@ -1,9 +1,7 @@
-import { DubApiError } from "@/lib/api/errors";
import { getLinkOrThrow } from "@/lib/api/links/get-link-or-throw";
import { parseRequestBody } from "@/lib/api/utils";
import { withWorkspace } from "@/lib/auth";
import { embedToken } from "@/lib/referrals/embed-token";
-import { ratelimit } from "@/lib/upstash";
import {
createEmbedTokenSchema,
embedTokenSchema,
@@ -19,23 +17,8 @@ export const POST = withWorkspace(
await getLinkOrThrow({ linkId, workspaceId: workspace.id });
- // TODO:
- // Need to reconsider this rate limit.
-
- const { success } = await ratelimit(10, "1 h").limit(linkId);
-
- if (!success) {
- throw new DubApiError({
- code: "rate_limit_exceeded",
- message:
- "Too many requests. You can only generate 10 tokens per hour per link.",
- });
- }
-
const response = await embedToken.create(linkId);
- console.log("response", response);
-
return NextResponse.json(embedTokenSchema.parse(response), {
status: 201,
});
diff --git a/packages/embeds/core/src/example/dashboard.html b/packages/embeds/core/src/example/dashboard.html
deleted file mode 100644
index 071c019d9e..0000000000
--- a/packages/embeds/core/src/example/dashboard.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<html></html>
- <head>
- <script type="module" src="../../dist/embed.js"></script>
- </head>
- <body>
- <h1>Dub Referral Dashboard</h1>
- <script>
- document.addEventListener("DOMContentLoaded", () => {
- Dub.init({
- token: "dub_embed_",
- type: "dashboard",
- });
- });
- </script>
- </body>
-</html>
\ No newline at end of file