#withSSRContext

4 messages · Page 1 of 1 (latest)

dull cave
#

Hey there,
I try to fetch data on the serverside. Only some users are able to listData so I need to use any auth mode. I use aws amplify (graphql and auth). I am using app directory and literally this is exact my problem: https://github.com/aws-amplify/amplify-js/issues/11210#issuecomment-1530959387

I also read the other comments, but for me there are no solutions.

I also tried it with this example: https://docs.amplify.aws/lib/ssr/q/platform/js/#2-prepare-a-request-object-for-withssrcontext-to-perform-server-side-operations-that-require-authentication
But to do cookie: headers().get('cookie'), I need to set somewhere a cookie. And I never worked with cookies and also don't know which value my cookie should have precisely because I don't simply want to list public data here, but user data that is only for certain users.

I could easily fetch all the data clientside (because I am logged in), but that's not the sense of nextjs, right? 🤔

GitHub

Before opening, please confirm: I have searched for duplicate or closed issues and discussions. I have read the guide for submitting bug reports. I have done my best to include a minimal, self-cont...

grand kelpBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

dull cave
#

Bump

dull cave
#

Solved: Amplify.configure with SSR on at login and the cookies are set