Sample repo for troubleshooting Next.js and AWS Amplify "No current user" at getServerSideProps - REST, not GraphQ
cd backend
npm install
- Make sure you have a valid GITHUB_TOKEN secret.
- Set a unique domain for your Cognito user pool here.
- Update the frontend Amplify configuration here to use the same unique domain
npm run deploy
Once the deployment is completed, get the output from the deployment (or check them on the Amplify deployed app/Environment variables) and configure env.local.sample with the deploy output values then rename the file to env.local
.
mv frontend/env.local.sample frontend/env.local
Install frontend dependencies:
cd frontend
npm install
cd frontend
npm run dev
Open http://localhost:3000 there will be two links: