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.

reduce to 3 hours

Steven Tey0f0dd7e872b5
diff --git a/apps/web/lib/embed/constants.ts b/apps/web/lib/embed/constants.ts
index ac7bc0c964..073212a5c5 100644
--- a/apps/web/lib/embed/constants.ts
+++ b/apps/web/lib/embed/constants.ts
@@ -1,3 +1,3 @@
// Embed public token
export const EMBED_PUBLIC_TOKEN_PREFIX = "dub_embed_";
-export const EMBED_PUBLIC_TOKEN_EXPIRY = 24 * 60 * 60; // 24 hours
+export const EMBED_PUBLIC_TOKEN_EXPIRY = 3 * 60 * 60; // 3 hours
diff --git a/apps/web/lib/embed/referrals/token-class.ts b/apps/web/lib/embed/referrals/token-class.ts
index f9af53060f..231be90d92 100644
--- a/apps/web/lib/embed/referrals/token-class.ts
+++ b/apps/web/lib/embed/referrals/token-class.ts
@@ -1,6 +1,5 @@
-import { redis } from "@/lib/upstash";
-
import { createId } from "@/lib/api/create-id";
+import { redis } from "@/lib/upstash";
import {
EMBED_PUBLIC_TOKEN_EXPIRY,
EMBED_PUBLIC_TOKEN_PREFIX,
@@ -24,7 +23,7 @@ class ReferralsEmbedToken {
return {
publicToken,
- expires: new Date(Date.now() + EMBED_PUBLIC_TOKEN_EXPIRY),
+ expires: new Date(Date.now() + EMBED_PUBLIC_TOKEN_EXPIRY * 1000),
};
}