Revert "trpc: check unlimited in middleware"
This reverts commit 90c0ef481b03bfb7d1a822dfa9e667f59f2c27b2.
This commit is contained in:
parent
9c3fa098b8
commit
5ae502c262
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user