Comments (3)
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?
from relay-nextjs.
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.
from relay-nextjs.
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!!!!!
from relay-nextjs.
Related Issues (20)
- approach recommended by vercel HOT 4
- Use with other server side props HOT 1
- Issue with react-i18next / next-i18next HOT 12
- "Expected preloadedQuery to not be disposed yet." error HOT 7
- WiredComponent.getInitialProps -> Always async HOT 1
- Missing configuration @ _document HOT 1
- Shallow route change refetches data HOT 15
- How to disable SSR? HOT 2
- Crashes with serverless functions HOT 1
- Wired components getServerInitialProps error when creating operation descriptor HOT 2
- Example is broken HOT 2
- Page component got mount again when using array in query variables HOT 2
- Provider guidance when using relay nextjs in 404 pages
- Redirect post query on relay-nextjs v2 HOT 4
- Question around seemingly optional `<Suspense />` usage HOT 1
- Usage with Nextjs 13 App Router HOT 5
- Try to expose GraphQL response headers to serverSidePostQuery HOT 1
- Instances of `Error: This Suspense boundary received an update before it finished hydrating` HOT 4
- TypeError: can't define property "__indexColor": Object is not extensible HOT 1
- Problem with 2.0 migration HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relay-nextjs.