Ahmed Eid
Ahmed Eid2y ago

subscription

How do you guys Authenticate / Authorize Subscription ?
5 Replies
Ahmed Eid
Ahmed Eid2y ago
the examples seem to be using publicProcedures, I've also tried using none public procedures but the don't work because I'm sending the token via the headers. and as far as I know you can't send headers for websockets.
Alex / KATT 🐱
somehow it works in the websockets example 😄 cookies are still sent to ws afaict
Ahmed Eid
Ahmed Eid2y ago
but the procedure still public right ? also how would it work with React Native ? without utilizing cookies ?
Alex / KATT 🐱
i don't do much RN, do some exploration, maybe req headers might work there instead might be that something small needs adding in trpc to account for this maybe WebSocketClientOptions needs to include headers-callback similarly to how the http links work
Ahmed Eid
Ahmed Eid2y ago
I am looking into it, thanks Alex. I thought I'd get some of the communities ideas.