-
StoryAs a server I want to be able to authenticate users and attach user context to request. I want to be able to parse the incoming websocket request the same way as regular HTTP request and allow e.g. passport to attach user to request object so it can be later used in graphql Acceptance criteria
Additional contextIn my case I modified the proposed
but it doesn't seem to work as expected. Inspiration: https://stackoverflow.com/a/53199673/5069352 Is this something already possible or not supported at the moment? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
When using Sadly, I've never used Passport before, so I cannot tell you what exactly the issue is - but since you're using Cookies, I guess Passport has to be a middleware that is run before ever establishing a WebSocket connection. |
Beta Was this translation helpful? Give feedback.
When using
useServer
, the context holds the WebSocket and the initial request in theextra
prop.Sadly, I've never used Passport before, so I cannot tell you what exactly the issue is - but since you're using Cookies, I guess Passport has to be a middleware that is run before ever establishing a WebSocket connection.