tRPCttRPC
Powered by
RodeoSpriteR
tRPC•3mo ago•
1 reply
RodeoSprite

Unauthorized Error while prefetching from protected procedure

I was working on a nextjs monorepo using trpc as backend I am integrating SSE with normal trpc methods, I implemented auth using better auth and it works very smoothly, but when I try to prefetch on server components I get not authenticated user error, but after render the app works without error. I checked further and reached upon conclusion that cookies aren't resolved because when I tried passing headers vis prop drilling from TRPC provider and using those in getting auth it worked and prefetching worked. Here is my problem, any help would be appreciated
https://stackoverflow.com/questions/79823260/trpc-prefetching-fails-on-protected-procedure
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to handle 500s from prefetching
JDJJD / ❓-help
5mo ago
Send File Back From Procedure
VengeanceVVengeance / ❓-help
2y ago