highstorm
highstorm copied to clipboard
Redundant code ?
In the trpc file this code
export const auth = t.middleware(({ next, ctx }) => { if (!ctx.user?.id) { throw new TRPCError({ code: "UNAUTHORIZED" }); } return next({ ctx: { user: ctx.user, tenant: ctx.tenant ?? { id: ctx.user.id, slug: "home", role: "owner" }, //this seems unnecessary as we are already doing this in the Context file }, }); });