Skip to content

Redundant code ? #36

Description

@Adugnatad

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions