Closed monoppa closed 3 years ago
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.
Got it! Actually had the same realization hence closed the issue. Appreciate your reply. Thanks!
Hi! Awesome library you have here.
Wondering if by any chance you have a nice way of doing authenticated requests on client-side.
Any chance we could expose
ctx
from next forcreateClientEnvironment
? Would this be a good idea?EDIT: Forked the package, the code below will not work. May I have other ideas how to have make authenticated requests client-side via relay-nextjs using withRelay?
It would look like this for
getClientEnvironment