fix: username is visible in private booking link (#19054)

This commit is contained in:
Benny Joo
2025-02-02 22:36:24 -07:00
committed by GitHub
parent f0dc3bba17
commit ca650babaf
3 changed files with 20 additions and 7 deletions
@@ -78,6 +78,7 @@ const BookerComponent = ({
hasValidLicense,
isBookingDryRun: isBookingDryRunProp,
renderCaptcha,
hashedLink,
}: BookerProps & WrappedBookerProps) => {
const searchParams = useCompatSearchParams();
const isPlatformBookerEmbed = useIsPlatformBookerEmbed();
@@ -389,6 +390,7 @@ const BookerComponent = ({
event={event.data}
isPending={event.isPending}
isPlatform={isPlatform}
isPrivateLink={!!hashedLink}
locale={userLocale}
/>
{layout !== BookerLayouts.MONTH_VIEW &&
@@ -47,6 +47,7 @@ export const EventMeta = ({
event,
isPending,
isPlatform = true,
isPrivateLink,
classNames,
locale,
}: {
@@ -73,6 +74,7 @@ export const EventMeta = ({
| "autoTranslateDescriptionEnabled"
> | null;
isPending: boolean;
isPrivateLink: boolean;
isPlatform?: boolean;
classNames?: {
eventMetaContainer?: string;
@@ -153,6 +155,7 @@ export const EventMeta = ({
users={event.subsetOfUsers}
profile={event.profile}
entity={event.entity}
isPrivateLink={isPrivateLink}
/>
<EventTitle className={`${classNames?.eventMetaTitle} my-2`}>
{translatedTitle ?? event?.title}
@@ -17,9 +17,16 @@ export interface EventMembersProps {
users: BookerEvent["subsetOfUsers"];
profile: BookerEvent["profile"];
entity: BookerEvent["entity"];
isPrivateLink: boolean;
}
export const EventMembers = ({ schedulingType, users, profile, entity }: EventMembersProps) => {
export const EventMembers = ({
schedulingType,
users,
profile,
entity,
isPrivateLink,
}: EventMembersProps) => {
const username = useBookerStore((state) => state.username);
const isDynamic = !!(username && username.indexOf("+") > -1);
const isEmbed = useIsEmbed();
@@ -40,7 +47,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
{
// We don't want booker to be able to see the list of other users or teams inside the embed
href:
isEmbed || isPlatform
isEmbed || isPlatform || isPrivateLink
? null
: entity.teamSlug
? getTeamUrlSync({ orgSlug: entity.orgSlug, teamSlug: entity.teamSlug })
@@ -59,11 +66,12 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
items={[
...orgOrTeamAvatarItem,
...shownUsers.map((user) => ({
href: isPlatform
? null
: `${getBookerBaseUrlSync(user.profile?.organization?.slug ?? null)}/${
user.profile?.username
}?redirect=false`,
href:
isPlatform || isPrivateLink
? null
: `${getBookerBaseUrlSync(user.profile?.organization?.slug ?? null)}/${
user.profile?.username
}?redirect=false`,
alt: user.name || "",
title: user.name || "",
image: getUserAvatarUrl(user),