Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant code ? #36

Open
Adugnatad opened this issue Aug 10, 2023 · 0 comments
Open

Redundant code ? #36

Adugnatad opened this issue Aug 10, 2023 · 0 comments

Comments

@Adugnatad
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant