highstorm icon indicating copy to clipboard operation
highstorm copied to clipboard

Redundant code ?

Open Adugnatad opened this issue 2 years ago • 0 comments

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 }, }); });

Adugnatad avatar Aug 10 '23 12:08 Adugnatad