Amplify + Next.js SSR + CDK Backend -- no current user error consistently

0

Having a terrible time setting up a simple "blogs list" and individual "blogs post" toy example. If I do everything in amplify, it just works. If I create the backend in CDK and bring over the aws-exports.json, some settings are not being picked up.

Of course, I have Amplify.configure(...awsExports, ssr: true) in all files.

I've tried muliple versions of getserversideprops plus :

  1. aws-exports with all settings on one level, and also the nested version with "API" and "Auth" segregated
  2. Copy pasted in the aws-exports in to the [id].js file

The blogs list page renders as expected after I have logged in. When I try to access a specific blog post, I am routed to the page and the error "no current user" is raised. Clearly, I am authorized already.

i am thinking of doing everything through CDK and seeing if that eliminates some settings issues. Using CDK for the backend is a must since appsync on amplify is horribly slow to push / develop.

TIA for any assistance.

V.

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions