Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Latest commit

 

History

History
21 lines (15 loc) · 627 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 627 Bytes

NestJS + NextJS + AWS Cognito Example

Working example for setting up AWS Cognito for NestJS as backend and NextJS as frontend

Features

  • Authenticate AWS Cognito on NestJS backend, using NextJS as frontend with proxy middleware to prevent CORS & utilize httpOnly cookies.
  • GraphQL login with automatic JWT token refresh
  • REST login (TODO)

Setup

  • Create AWS Cognito User Pool

  • Edit backend .env and add AWS Cognito credentials

  • Edit frontend .env and specify urls

  • Run both frontend & backend on port 3000 & 4000 respectively

    yarn --cwd frontend-nextjs dev
    yarn --cwd backend-nestjs dev