The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update links.ts
Steven Tey899f902cb00d
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.tsindex 04b1836e4a..bf5f167159 100644--- a/apps/web/lib/api/links.ts+++ b/apps/web/lib/api/links.ts@@ -175,11 +175,14 @@ export async function getRandomKey(domain: string): Promise<string> {export async function checkIfKeyExists(domain: string, key: string) {// reserved keys for dub.shif (domain === "dub.sh") {- return (await isReservedKey(key)) || DEFAULT_REDIRECTS[key];-+ if ((await isReservedKey(key)) || DEFAULT_REDIRECTS[key]) {+ return true;+ }// if it's a default Dub domain, check if the key is a reserved key} else if (isDubDomain(domain)) {- return await isReservedUsername(key);+ if (await isReservedUsername(key)) {+ return true;+ }}const link = await prisma.link.findUnique({where: {