Skip to content

Scheduling infrastructure for absolutely everyone.

fix: dont link to org url inside embeds (#13668)

Peer Richelsenbb9f8e5d389c
diff --git a/packages/ui/components/avatar/Avatar.tsx b/packages/ui/components/avatar/Avatar.tsx
index 6ebd05d114e..6fd5c75ce07 100644
--- a/packages/ui/components/avatar/Avatar.tsx
+++ b/packages/ui/components/avatar/Avatar.tsx
@@ -15,7 +15,7 @@ export type AvatarProps = {
imageSrc?: Maybe<string>;
title?: string;
alt: string;
- href?: string;
+ href?: string | null;
fallback?: React.ReactNode;
accepted?: boolean;
asChild?: boolean; // Added to ignore the outer span on the fallback component - messes up styling
diff --git a/packages/ui/components/avatar/AvatarGroup.tsx b/packages/ui/components/avatar/AvatarGroup.tsx
index 113886e67bc..5ecf80891a3 100644
--- a/packages/ui/components/avatar/AvatarGroup.tsx
+++ b/packages/ui/components/avatar/AvatarGroup.tsx
@@ -8,7 +8,7 @@ export type AvatarGroupProps = {
image: string;
title?: string;
alt?: string;
- href?: string;
+ href?: string | null;
}[];
className?: string;
truncateAfter?: number;
diff --git a/packages/ui/components/avatar/UserAvatarGroupWithOrg.tsx b/packages/ui/components/avatar/UserAvatarGroupWithOrg.tsx
index 416311001a2..cb898760f4d 100644
--- a/packages/ui/components/avatar/UserAvatarGroupWithOrg.tsx
+++ b/packages/ui/components/avatar/UserAvatarGroupWithOrg.tsx
@@ -1,3 +1,4 @@
+import { useIsEmbed } from "@calcom/embed-core/embed-iframe";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
import { getBookerBaseUrlSync } from "@calcom/lib/getBookerUrl/client";
@@ -15,9 +16,12 @@ type UserAvatarProps = Omit<React.ComponentProps<typeof AvatarGroup>, "items"> &
export function UserAvatarGroupWithOrg(props: UserAvatarProps) {
const { users, organization, ...rest } = props;
+ const isEmbed = useIsEmbed();
+
const items = [
{
- href: getBookerBaseUrlSync(organization.slug),
+ // We don't want booker to be able to see the list of other users or teams inside the embed
+ href: isEmbed ? null : getBookerBaseUrlSync(organization.slug),
image: `${WEBAPP_URL}/team/${organization.slug}/avatar.png`,
alt: organization.name || undefined,
title: organization.name,