Skip to content

The Open Source DocuSign Alternative.

fix: restrict team verification tokens (#927)

David Nguyena868ecf2d264
diff --git a/apps/web/src/app/(teams)/t/[teamUrl]/settings/team-transfer-status.tsx b/apps/web/src/app/(teams)/t/[teamUrl]/settings/team-transfer-status.tsx
index cba50966f..92f89c01e 100644
--- a/apps/web/src/app/(teams)/t/[teamUrl]/settings/team-transfer-status.tsx
+++ b/apps/web/src/app/(teams)/t/[teamUrl]/settings/team-transfer-status.tsx
@@ -18,7 +18,7 @@ export type TeamTransferStatusProps = {
className?: string;
currentUserTeamRole: TeamMemberRole;
teamId: number;
- transferVerification: TeamTransferVerification | null;
+ transferVerification: Pick<TeamTransferVerification, 'email' | 'expiresAt' | 'name'> | null;
};
export const TeamTransferStatus = ({
diff --git a/packages/lib/server-only/team/get-team.ts b/packages/lib/server-only/team/get-team.ts
index 59331202e..f2fd9cd4f 100644
--- a/packages/lib/server-only/team/get-team.ts
+++ b/packages/lib/server-only/team/get-team.ts
@@ -72,8 +72,20 @@ export const getTeamByUrl = async ({ userId, teamUrl }: GetTeamByUrlOptions) =>
where: whereFilter,
include: {
teamEmail: true,
- emailVerification: true,
- transferVerification: true,
+ emailVerification: {
+ select: {
+ expiresAt: true,
+ name: true,
+ email: true,
+ },
+ },
+ transferVerification: {
+ select: {
+ expiresAt: true,
+ name: true,
+ email: true,
+ },
+ },
subscription: true,
members: {
where: {