diff --git a/apps/web/server/middleware.ts b/apps/web/server/middleware.ts index 7347334..ac633b1 100644 --- a/apps/web/server/middleware.ts +++ b/apps/web/server/middleware.ts @@ -27,12 +27,6 @@ export const userMiddleware = t.middleware(async ({ ctx, next }) => { const unlimited = systemuser?.roles?.some((x) => x?.name && unlimitedRoles.includes(x.name)); - if (!unlimited) { - throw new TRPCError({ - code: 'UNAUTHORIZED', - }); - } - return next({ ctx: { unlimited, diff --git a/apps/web/server/routers/calculate/index.ts b/apps/web/server/routers/calculate/index.ts index 50aceb9..67230f7 100644 --- a/apps/web/server/routers/calculate/index.ts +++ b/apps/web/server/routers/calculate/index.ts @@ -17,7 +17,7 @@ export const calculateRouter = router({ const apolloClient = initializeApollo(); const queryClient = new QueryClient(); - if (ctx.unlimited === false) { + if (!ctx.unlimited) { const validationResult = await validate({ context: { apolloClient, diff --git a/apps/web/server/routers/quote/index.ts b/apps/web/server/routers/quote/index.ts index 463d8b1..4fa50d1 100644 --- a/apps/web/server/routers/quote/index.ts +++ b/apps/web/server/routers/quote/index.ts @@ -91,7 +91,7 @@ export const quoteRouter = router({ const apolloClient = initializeApollo(); const queryClient = new QueryClient(); - if (ctx.unlimited === false) { + if (!ctx.unlimited) { const validationResult = await validate({ context: { apolloClient,