vic / apollo-phoenix-websocket

An Apollo networkInterface for executing GraphQL queries via Phoenix Channels
Apache License 2.0
91 stars 9 forks source link

Authentication workaround #23

Closed G3z closed 7 years ago

G3z commented 7 years ago

I've imagined the steps for a login with APW like so

step Client Server
1 Create connection
2 Create empty context
3 Send login mutation
4 Populate context with user
5 Receive token
6 Store token for later use (see #22 )

turns out (as @benwilson512 pointed out) step 4 is not feasible at the moment

it was only pointed out to me yesterday that this (step 4) is an issue for websockets because there isn't a way to alter or change the context of the websocket connection when doing HTTP you can basically set it uniquely on each request but for websockets that doesn't work, cause the context is setup once

do you think it's possible to build a workaround for this if/until absinthe is modified maybe is it possible to force a disconnection/reconnection manually (so that token is picked up)

G3z commented 7 years ago

issue resolved in absinthe 1.4.0-rc1 & absinthe_phoenix 1.4.0-rc1