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.

沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南