Skip to content

React.js with AWS Cognito for authentication and account scaffolding

License

Notifications You must be signed in to change notification settings

bluepeter/react-mobx-aws-cognito

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React.js, MobX, AWS Cognito

This is an authentication-focused single page app starter/seed. This project adds AWS Cognito support for authentication. This greatly simplifies and speeds up app development as AWS handles all of the tedious back-end related authentication tasks. We used this seed ourselves to build the front-end for Fluxguard.

  • React.js and AWS Cognito integration to:
    • Create an account
    • Verify email address (via pin emailed to address)
    • Login
    • Logout
    • Verify existing session
    • Change password
    • Delete account
  • Includes react-bootstrap.
  • Check out package.json for more stack choices.

How to use

  • Clone this repo!
  • Go to the AWS console and create a new Cognito user pool. When you do this, review the default settings and make the following changes:
    • Change the sign-in method to "email address or phone number"
    • Uncheck "email" from required attributes
    • Require email verification (this is checked by default, so don't adjust it). You may need to create a new SMS role to allow AWS to send emails on your behalf.
    • Add an "app client" (note that creating one at the same time appears to be broken in the AWS console at this time, so you can create it immediately after the user pool is created)
      • When you create the app client, UNCHECK "generate client secret" as this project does not currently support this new-ish feature.
  • Copy the "Pool Id" and put it in .env
  • Click on "app client settings" and copy the "App client id" and put it in .env. Make sure "Cognito User Pool" is CHECKED under "Enabled Identity Providers".
  • Go to "app client settings" and check "Cognito user pool" under "enabled identity providers."
  • yarn to install everything
  • yarn run start to run locally.
  • Create an account, login, etc!

Screenshots

Screenshot

Screenshot

Screenshot

About

React.js with AWS Cognito for authentication and account scaffolding

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published