Derock
Explore posts from serversis there a way to send a streaming response
just found https://github.com/trpc/trpc/pull/4911
6 replies
How to set cookies in trpc response?
@Zeryther / @DxD
My solution was the following:
inside of the route handler for TRPC, I passed the response headers:
and then updated createTRPCContext to store the resHeaders in the context, and in my tRPC routes I was able to access that and set the cookie using
Lastly, the template I used (t3-app) uses
unstable_httpBatchStreamLink
by default. Setting headers is not supported in this, so I had to use a splitLink so that my auth requests would use httpLink
instead.11 replies