Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
⚡️ Short circuit subscription call for guests
Luke Vella48f2fa90bd4f
diff --git a/packages/backend/trpc/routers/user.ts b/packages/backend/trpc/routers/user.tsindex 56541bede..b153b95b8 100644--- a/packages/backend/trpc/routers/user.ts+++ b/packages/backend/trpc/routers/user.ts@@ -20,6 +20,13 @@ export const user = router({});}),subscription: possiblyPublicProcedure.query(async ({ ctx }) => {+ if (ctx.user.isGuest) {+ // guest user can't have an active subscription+ return {+ active: false,+ };+ }+const user = await prisma.user.findUnique({where: {id: ctx.user.id,