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.

Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas