Closed saltas888 closed 8 years ago
WHAT-WG Fetch API that DefaultNetworkLayer
uses internally doesn't understand what the session
property means.
Instead, you should use it like this:
const networkLayer = new Relay.DefaultNetworkLayer(
GRAPHQL_URL,
{ headers: { cookie: req.headers.cookie } },
);
Hello, I'm creating a basic user authentication with server side rendering...
My server looks like this
https://github.com/jkettmann/relay-authentication/blob/master/server/server.js
where graphqlServer: https://github.com/jkettmann/relay-authentication/blob/master/server/graphQlServer.js
i have also appended a render function in the server.js file:
Now, when I refresh the page, I got in the graphql server an empty session and then it creates an anonymous token.
But, if I go in a page, that needs data from relay, without page reload then I get the session with the logged in user token.
It seems like that injecting the session in networkLayer doesn't work...
What is my fault?