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? 🤔