T
tRPC

Can middleware be used on a router?

Can middleware be used on a router?

Aaryzing11/3/2023
Given a router where all procedures need to use the same middleware, can the middleware be somehow attached to the router instead of manually to routes? For example, given an "admin" router, it would be quite catastrophic if one of the endpoints was accidentally set up with a publicProcedure instead of adminProcedure = publicProcedure.use(isAdmin).
Solution:
no, it’s not possible
Jump to solution
Solution
Ssachin11/3/2023
no, it’s not possible

Looking for more? Join the community!

T
tRPC

Can middleware be used on a router?

Join Server