Learn how to add user authentication into React apps, including email verification, password resets, and best practices.
Overview
Syllabus
Introduction
- Take advantage of React authentication
- What you should know
- The structure of this course
- What is user authentication?
- Basic project setup
- Building a login page
- Building a sign-up page
- Creating private React routes
- JSON Web Token basics
- Adding a sign-up route to the server
- Generating JSON Web Tokens
- Adding a login route to the server
- Implementing JWTs on the front end
- Adding JWTs to sign-up page
- Adding JWTs to login page
- Adding an update user route
- Verifying JSON Web Tokens
- Adding JWTs to the user info page
- Adding logout functionality
- The basic email verification process
- Setting up an email provider
- Sending emails from Node
- Integrating verification tokens
- Creating a verify email page
- Adding a verify email route
- Creating a verification landing page
- Handling successful and failed verifications
- The basic password reset process
- Adding a forgot password page
- Sending a reset password email
- Creating a reset password landing page
- Handling password reset success and failure
- Adding a reset password server endpoint
- OAuth basics
- Setting up OAuth on Google
- Adding an OAuth URL route
- Creating a "Sign in with Google" button
- Loading user info from Google
- Creating new users from OAuth data
- Adding an OAuth callback route
- Handling successful OAuth authentication
- Amazon Cognito basics
- Setting up an AWS Cognito project
- Creating a user pool in Node.js
- Converting the sign-up endpoint to AWS
- Converting the sign-up page to AWS
- Modifying the email verification flow
- Converting the verify email route
- Converting the login route
- Converting the forgot password route
- Rewriting the reset password endpoint
- Converting the reset password page
- Using HTTPS and SSL
- Salting and peppering passwords
- Never trust the front end
- Authentication error handling
- Catching and handling errors
- Securing your database
- Conclusion and next steps
Taught by
Shaun Wassell