The code is a modification of the code from Serverless Stack. All credit goes to the people who built that awesome website: Frank Wang and Jay V.
The app lets you:
- Create an account with your email address.
- Verify your account with AWS Cognito.
- Login and logout.
- Reset your password by sending a confirmation code to your email.
🚧 TODO:
- User settings: change email, change password.
- Code splitting for Router.
Main difference(s) between this app and the example on serverless-stack.com:
- This app uses Bootstrap 4 with reactstrap instead of Bootstrap 3.
- In an S3 bucket.
You need:
You don't need S3, Lambda, API Gateway or DynamoDB for this example.
Create a config.js
file inside ./src
that looks like ./src/config.js-example
.
NOTE: It is ok to expose USER_POOL_ID
, APP_CLIENT_ID
and IDENTITY_POOL_ID
as explained by AWS. If you want to secure API calls to the back-end (DynamoDB, S3, etc.), use API Gateway with Cognito, but that is out of the scope of this example.
You can use each component inside ./src/components
for your app. Make sure you have all the dependencies required in each component.
You can also copy the whole ./src
folder and use it as a standalone component to authenticate user for your app.
Follow the guide on Serverless Stack website.
- Viet Nguyen