Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔒️ Stop polls.get disclosing scheduled invitee names and emails (#3247)

Luke Vella0db11a2cd9e4
diff --git a/apps/web/src/trpc/client/types.ts b/apps/web/src/trpc/client/types.ts
index d87b9339e..679ff232a 100644
--- a/apps/web/src/trpc/client/types.ts
+++ b/apps/web/src/trpc/client/types.ts
@@ -21,7 +21,6 @@ export type GetPollApiResponse = {
id: string;
start: Date;
duration: number;
- attendees: Array<{ name: string; email: string; status: string }>;
status: string;
} | null;
};
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.ts
index 1a5bedbeb..99f77a44a 100644
--- a/apps/web/src/trpc/routers/polls.ts
+++ b/apps/web/src/trpc/routers/polls.ts
@@ -760,15 +760,6 @@ export const polls = router({
end: true,
allDay: true,
status: true,
- invites: {
- select: {
- id: true,
- inviteeName: true,
- inviteeEmail: true,
- inviteeTimeZone: true,
- status: true,
- },
- },
},
},
},
@@ -801,16 +792,6 @@ export const polls = router({
dayjs(res.scheduledEvent.start),
"minute",
),
- attendees: res.scheduledEvent.invites
- .map((invite) => ({
- name: invite.inviteeName,
- email: invite.inviteeEmail,
- status: invite.status,
- }))
- .filter(
- (invite) =>
- invite.status === "accepted" || invite.status === "tentative",
- ),
status: res.scheduledEvent.status,
}
: null;
@@ -821,8 +802,12 @@ export const polls = router({
? isSpaceBrandingActive({ ...res.space, spaceBrandingAllowed })
: false;
+ // `event` above is the shape clients read; the raw row would be a
+ // second copy of the same booking in a public payload.
+ const { scheduledEvent: _scheduledEvent, ...pollFields } = res;
+
return {
- ...res,
+ ...pollFields,
space: res.space
? {
...res.space,