This is a bit tricky for two reasons:
AngelLoredoAlvarez opened this issue · 3 comments
This is a bit tricky for two reasons:
-
I'm not sure having the Relay environment change network after initializing works?
-
Requests must be made on both the client side and server side, so using local storage based authentication won't work because it's not available on the server.
For these reasons I recommend using cookies for your auth solution.
Originally posted by @rrdelaney in #20 (comment)
This is a bit tricky for two reasons:
- I'm not sure having the Relay environment change network after initializing works?
- Requests must be made on both the client side and server side, so using local storage based authentication won't work because it's not available on the server.
For these reasons I recommend using cookies for your auth solution.
Originally posted by @rrdelaney in #20 (comment)
According to this issue, the recommended way to authenticate is with cookies, my question is, that way works in both relay environments?, or just in the client environment?
I'd recommend using cookies for both. For the server-side render you should have access to cookies in req.cookies
and on the client-side render make sure you're passing cookies along with your HTTP request to the server.
I'd recommend using cookies for both. For the server-side render you should have access to cookies in
req.cookies
and on the client-side render make sure you're passing cookies along with your HTTP request to the server.
Got it!!!, thank you again!!!!!