aryzingA
tRPC3y ago
3 replies
aryzing

Can middleware be used on a router?

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
Was this page helpful?