Stephane M
Stephane M3d ago

create middleware

Hi all, still reading the docs since several hours, im kinda confused about the best way to create a middleware (in my case right now, for auth). some tutos show the t.middleware way, but docs show t.procedure.use(). are there some differences between the two we should be aware ? also doc says
Creating middlewares using t.middleware has the limitation that the Context type is tied to the Context type of the tRPC instance.
Creating middlewares using t.middleware has the limitation that the Context type is tied to the Context type of the tRPC instance.
im not sure i fully understand what it means. does anyone have some insight about this ? (i am not using srr, just react with vite) thank you 🙂
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?