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));
|
const unlimited = systemuser?.roles?.some((x) => x?.name && unlimitedRoles.includes(x.name));
|
||||||
|
|
||||||
if (!unlimited) {
|
|
||||||
throw new TRPCError({
|
|
||||||
code: 'UNAUTHORIZED',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return next({
|
return next({
|
||||||
ctx: {
|
ctx: {
|
||||||
unlimited,
|
unlimited,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const calculateRouter = router({
|
|||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo();
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
if (ctx.unlimited === false) {
|
if (!ctx.unlimited) {
|
||||||
const validationResult = await validate({
|
const validationResult = await validate({
|
||||||
context: {
|
context: {
|
||||||
apolloClient,
|
apolloClient,
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export const quoteRouter = router({
|
|||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo();
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
if (ctx.unlimited === false) {
|
if (!ctx.unlimited) {
|
||||||
const validationResult = await validate({
|
const validationResult = await validate({
|
||||||
context: {
|
context: {
|
||||||
apolloClient,
|
apolloClient,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user