Closed G3z closed 7 years ago
I have exactly the same problem. Couldn't find the answer anywhere, maybe @vic can help?
Got the answer on Slack today! You can pass the token to your connect
params like so:
networkInterface.use([{
applyMiddleware({ request, options }, next) {
const token = 'my-secret-token'
options.params = {
...options.params,
guardian_token: token,
}
next()
},
}])
thanks @richeterre I tried and it's working. @vic should I edit the readme with this example ?
Now that absinthe_phoenix supports context, the above snippet changing networkInterface is perfect. Maybe replace the auth bit in the readme with that?
@joshuataylor , @G3z yes please if you are using an updated version of absinthe_phoenix, please send a PR updating the README with a proper example.
Thank you.
i tried adding a context as showed in the readme
but on phoenix this is what i get
%{"vsn" => "1.0.0"}
am I doing something wrong ?