In this workshop we covered:
- How to hash and verify a userโs password.
- How to let a user login with their email and password (basic login)
- How to let users login with tokens
- How to create a middleware to authenticate users
Timestamps
- 0:00 Recap of previous session
- 1:30 Adding passwords to users
- 5:30 Hiding passwords in the response to the frontend
- 6:30 Leaving notes for testing a user service
- 8:50 My preferred way to handle Mongoose validation errors
- 12:30 Hashing the password
- 19:00 Allowing a user to login
- 23:00 Login functionality with middlewares
- 28:50 Using the Authorization Header for Basic Authentication
- 41:48: Supporting Bearer authentication
- 44:51 Creating an access token
- 53:26 Decoding the access token
- 58:35 Quick recap about the authentication middleware
- 59:41 Protecting the JWS secret with dotenv
- 1:05:23 Questions and Answers
Reference Async JS Course which is well โ I can link directly here.
Create the entire authentication middleware from scratch.
Welcome! Unfortunately, you donโt have access to this lesson. To get access, please purchase the workshop or enroll in Magical Dev School.
Unlock this lesson