rp
08/13/2021, 10:18 AMZeferiniX
08/13/2021, 10:18 AMreq
objectZeferiniX
08/13/2021, 10:18 AMrp
08/13/2021, 10:19 AMZeferiniX
08/13/2021, 10:19 AMhttp
rp
08/13/2021, 10:19 AMconnect()
function to call on the frontend?ZeferiniX
08/13/2021, 10:21 AMcreateServer
is from the http
lib, the app
variable is the express app
inside the initApolloGraphqlServer
is where we register apollo-server-express
as a middleware which is all good for http requests AND also where the subscription server is created separatelyrp
08/13/2021, 10:22 AMonConnect
function?
I ask because you can implement the followingZeferiniX
08/13/2021, 10:23 AMrp
08/13/2021, 10:25 AMsessionHandle
of the session to the client. Else some error
- If the client gets the session handle, it passes that to the request to the onConnect
function.
- In the onConnect
function, if the req doesn't have a sessionHandle
, then return false
(which will cause a disconnection). Else query the supertokens core to check if the sessionHandle
exists. If it doesn't return false
, else return the context object to establish the connection.ZeferiniX
08/13/2021, 10:29 AMZeferiniX
08/13/2021, 10:31 AMSessionObject.getHandle()
?rp
08/13/2021, 10:31 AMZeferiniX
08/13/2021, 10:32 AMrp
08/13/2021, 10:32 AMZeferiniX
08/13/2021, 10:32 AMrp
08/13/2021, 10:33 AMZeferiniX
08/13/2021, 10:33 AMonConnect
via supertokens-node.getSessionData(), yes?ZeferiniX
08/13/2021, 10:33 AMZeferiniX
08/13/2021, 10:33 AMZeferiniX
08/13/2021, 10:33 AMrp
08/13/2021, 10:34 AMrp
08/13/2021, 10:34 AMZeferiniX
08/13/2021, 10:34 AMrp
08/13/2021, 10:34 AMZeferiniX
08/13/2021, 10:35 AMZeferiniX
08/13/2021, 10:36 AMZeferiniX
08/13/2021, 10:37 AMrp
08/13/2021, 10:39 AMZeferiniX
08/13/2021, 10:41 AM