Updated 2021 MERN stack user authentication tutorial series. In this tutorial series, I’m setting up a project template for working with user authentication in the MERN stack. You will learn to register user accounts to a MongoDB database, log in users on the react frontend and verify logged in users. The authentication is secured by technologies such as JsonWebTokens, Bcrypt and HTTP-only cookies. We’ll be using react hooks and the context API to deal with the state management of the user authentication in the frontend.

MERN stack complete course: https://www.udemy.com/course/mern-stack-complete-full-stack-apps-from-scratch/?referralCode=3CF0931F54A6CB83B1A5

Insomnia API tester: https://insomnia.rest/
Finished code on github: https://github.com/jgbijlsma/mern-auth-template-tutorial

Chapters

  • 00:00 “Check if logged” endpoint
  • 04:22 Auth context
  • 13:58 Conditional rendering based on logged-in state
  • 19:55 Log out button

#react #jwt #mongodb #node

MERN Stack Secure Authentication Part 11 | React Auth Context | JWT, Cookies, Bcrypt, React Hooks
3.65 GEEK