-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into utm-templates
- Loading branch information
Showing
7 changed files
with
113 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
import { | ||
getFeatureFlags, | ||
isBlacklistedDomain, | ||
updateConfig, | ||
} from "@/lib/edge-config"; | ||
import { isBlacklistedDomain, updateConfig } from "@/lib/edge-config"; | ||
import { getPangeaDomainIntel } from "@/lib/pangea"; | ||
import { checkIfUserExists, getRandomKey } from "@/lib/planetscale"; | ||
import { prisma } from "@/lib/prisma"; | ||
|
@@ -197,7 +193,11 @@ export async function processLink<T extends Record<string, any>>({ | |
// coerce type with ! cause we already checked if it exists | ||
const { allowedHostnames } = DUB_DOMAINS.find((d) => d.slug === domain)!; | ||
const urlDomain = getApexDomain(url) || ""; | ||
if (allowedHostnames && !allowedHostnames.includes(urlDomain)) { | ||
if ( | ||
key !== "_root" && | ||
allowedHostnames && | ||
!allowedHostnames.includes(urlDomain) | ||
) { | ||
return { | ||
link: payload, | ||
error: `Invalid destination URL. You can only create ${domain} short links for URLs with the domain${allowedHostnames.length > 1 ? "s" : ""} ${allowedHostnames | ||
|
@@ -207,20 +207,6 @@ export async function processLink<T extends Record<string, any>>({ | |
}; | ||
} | ||
|
||
if (domain === "cal.link") { | ||
const flags = await getFeatureFlags({ | ||
workspaceId: workspace?.id, | ||
}); | ||
if (!flags?.callink) { | ||
return { | ||
link: payload, | ||
error: | ||
"You can only use the cal.link domain if you have beta access to it. Contact [email protected] to get access.", | ||
code: "forbidden", | ||
}; | ||
} | ||
} | ||
|
||
if (key?.includes("/")) { | ||
// check if the user has access to the parent link | ||
const parentKey = key.split("/")[0]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { SVGProps } from "react"; | ||
|
||
export function CalendarDays(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" {...props}> | ||
<g fill="currentColor"> | ||
<path | ||
d="M2.25 4.75C2.25 3.64543 3.14543 2.75 4.25 2.75H13.75C14.8546 2.75 15.75 3.64543 15.75 4.75V6.25H2.25V4.75Z" | ||
fill="currentColor" | ||
fillOpacity="0.3" | ||
stroke="none" | ||
/> | ||
<path | ||
d="M5.75 2.75V0.75" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
<path | ||
d="M12.25 2.75V0.75" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
<path | ||
d="M13.75 2.75H4.25C3.14543 2.75 2.25 3.64543 2.25 4.75V13.25C2.25 14.3546 3.14543 15.25 4.25 15.25H13.75C14.8546 15.25 15.75 14.3546 15.75 13.25V4.75C15.75 3.64543 14.8546 2.75 13.75 2.75Z" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
<path | ||
d="M2.25 6.25H15.75" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
<path | ||
d="M9 8.25C8.449 8.25 8 8.699 8 9.25C8 9.801 8.449 10.25 9 10.25C9.551 10.25 10 9.801 10 9.25C10 8.699 9.551 8.25 9 8.25Z" | ||
fill="currentColor" | ||
stroke="none" | ||
/> | ||
<path | ||
d="M12.5 10.25C13.051 10.25 13.5 9.801 13.5 9.25C13.5 8.699 13.051 8.25 12.5 8.25C11.949 8.25 11.5 8.699 11.5 9.25C11.5 9.801 11.949 10.25 12.5 10.25Z" | ||
fill="currentColor" | ||
stroke="none" | ||
/> | ||
<path | ||
d="M9 11.25C8.449 11.25 8 11.699 8 12.25C8 12.801 8.449 13.25 9 13.25C9.551 13.25 10 12.801 10 12.25C10 11.699 9.551 11.25 9 11.25Z" | ||
fill="currentColor" | ||
stroke="none" | ||
/> | ||
<path | ||
d="M5.5 11.25C4.949 11.25 4.5 11.699 4.5 12.25C4.5 12.801 4.949 13.25 5.5 13.25C6.051 13.25 6.5 12.801 6.5 12.25C6.5 11.699 6.051 11.25 5.5 11.25Z" | ||
fill="currentColor" | ||
stroke="none" | ||
/> | ||
<path | ||
d="M12.5 11.25C11.949 11.25 11.5 11.699 11.5 12.25C11.5 12.801 11.949 13.25 12.5 13.25C13.051 13.25 13.5 12.801 13.5 12.25C13.5 11.699 13.051 11.25 12.5 11.25Z" | ||
fill="currentColor" | ||
stroke="none" | ||
/> | ||
</g> | ||
</svg> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters