You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get the session from the cookies without using this as a middleware.
Instead I just need to grab session info from the cookies to use it with apollo graphql subscriptions with websockets.
I was trying to parse the cookies and looking at the code to try to find a way to achieve this, but it doesn't seem the correct way of doing it.
Not sure how though, maybe passing just req since is what we have with the ws. Or a check if there's no callback return the Session instead of populating the req.
If you just want to get the session contents (and not write back a new session -- which would not be possible without a res anyhow), you could likely just use the cookies module directly, which is what this module uses under the hood to read the cookie and validate the signature. A possible example:
I'm trying to get the session from the cookies without using this as a middleware.
Instead I just need to grab session info from the cookies to use it with apollo graphql subscriptions with websockets.
I was trying to parse the cookies and looking at the code to try to find a way to achieve this, but it doesn't seem the correct way of doing it.
Not sure how though, maybe passing just req since is what we have with the ws. Or a check if there's no callback return the Session instead of populating the req.
Would this be possible? I would be happy to contribute if it is.
Or there is an easy way to get the session?
Thanks
btw: just seen this one: apollographql/subscriptions-transport-ws#466
The text was updated successfully, but these errors were encountered: