Thimo_o
Explore posts from serversHow do I setup App router + TRPC + Lucia Auth? (protected routes)
I'm trying to setup tRPC with Lucia in app router but I struggle to make protected routes work.
I made a trpc context where I put lucia session and a getDefaultSession function to get the session
I wrote a isAuth function to make the protected procedure
and added it in my route.ts handler
But the session is not passed into ctx resulting in always getting the unauthorized error. Does someone know what I did wrong to make this work?
7 replies