How to implement the correct middleware in NextJS TRPC
I'm confused why this middleware doesn't work on nextjs version 13 which uses the pages directory.
/middleware.ts
/src/middlewares/withAuthorization
3 Replies
Solution
FIX
Sorry it was an error in the folder placement
where should it be placed?
For middleware.ts it must be in the project such as if using src then it must be in src, if directly root project then in root project
example:
use src
/src/middleware.ts
use root projek
/middleware.ts