Development

MERN Auth Tutorial

Intermediate
3h

By: Shaun Pelling

MERN Auth Tutorial

Overview

This course is focused on implementing authentication in applications built with the MERN stack—MongoDB, Express.js, React, and Node.js. It explains the principles of securing a MERN application by managing users, encrypting passwords, and generating tokens for session handling. The course examines how to set up authentication middleware in Express.js to protect routes and how to use JSON Web Tokens (JWT) for maintaining user sessions. Participants learn to build login and registration components in React, connect them to a Node.js backend, and handle user authentication state. It also covers best practices for securely storing sensitive information in MongoDB and deploying authenticated applications. By the end of the course, students are capable of creating secure MERN stack applications with robust user authentication systems.

Skills Learned

  • Setting up user authentication routes
  • Implementing user controllers and models
  • Signing up users and password hashing
  • Validating emails and passwords
  • Understanding JSON Web Tokens (JWT)
  • Generating and signing JWTs
  • Creating login functionality
  • Implementing React authentication context
  • Building login and signup forms in React
  • Developing custom authentication hooks in React
  • Creating a user logout mechanism
  • Managing initial authentication status in React
  • Securing backend API routes
  • Conducting authorized API requests
  • Implementing protected routes in React
  • Associating data with authenticated users

Modules

1. MERN Stack Authentication

1.1 Introduction & Starter Project13 min
1.2 User Routes, Controller & Model12 min
1.3 Signing up & Hashing Passwords13 min
1.4 Email & Password Validation6 min
1.5 JSON Web Tokens (Theory)8 min
1.6 Signing Tokens6 min
1.7 Logging Users In8 min
1.8 React Auth Context10 min
1.9 Login & Signup Forms9 min
1.10 Making a useSignup Hook13 min
1.11 Making a useLogout Hook7 min
1.12 Making a useLogin Hook6 min
1.13 Getting the Initial Auth Status9 min
1.14 Protecting API Routes14 min
1.15 Making Authorized Requests9 min
1.16 Protecting React Routes6 min
1.17 Assigning Workouts to Users12 min

Ready to Elevate Your Team's Learning?

Talk with our sales team to see how StormWind can transform the way your organization trains and grows.

CONTACT SALES