fix(user): scope user.get relation columns to reduce SSR payload size (#4730)

apiKeys and nested user were returned without column projection, shipping
secrets (key, permissions, metadata) and unused fields to every page that
prefetches user.get, causing the /dashboard/home SSR payload to exceed
Next.js's 128kB warning threshold.
This commit is contained in:
Mauricio Siu
2026-07-05 15:01:21 -06:00
committed by GitHub
parent b2692cd594
commit 3e74f9a374

View File

@@ -137,8 +137,31 @@ export const userRouter = createTRPCRouter({
),
with: {
user: {
columns: {
id: true,
firstName: true,
lastName: true,
email: true,
image: true,
allowImpersonation: true,
twoFactorEnabled: true,
stripeCustomerId: true,
stripeSubscriptionId: true,
serversQuantity: true,
isEnterpriseCloud: true,
sendInvoiceNotifications: true,
},
with: {
apiKeys: true,
apiKeys: {
columns: {
id: true,
name: true,
prefix: true,
enabled: true,
expiresAt: true,
createdAt: true,
},
},
},
},
},