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.

回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ