Node.js Express with Typescript Setup Part 3 - Securing Node.js Apps with JWT

Опубликовано: 17 Октябрь 2024
на канале: Paul and Code
188
8

Previous Video:    • Node.js Express with Typescript Setup...  
Next Video: [In Progress]

In this video, we dive into securing your Node.js application using JSON Web Tokens (JWT) for authentication. We’ll walk you through setting up environment variables, generating and verifying JWTs, and how the secret key works to protect your tokens.

Topics Covered:
• Setting up JWT for authentication in Node.js
• Generating and verifying JWTs
• Understanding the importance of the JWT secret key
• Securing your Node.js application

Check out the full codebase on GitHub:
Start here to follow along:
https://github.com/PaulAndCode/yt-typ...
Completed code:
https://github.com/PaulAndCode/yt-typ...

Supplement:
https://paulandcode.notion.site/Node-...

Chapters:
0:00 - Introduction
0:27 - 1. Install Packages
0:41 - 2. User Model
0:53 - 3. JWT Utility Function
1:55 - 4. User Registration and Login
3:58 - 5. Protecting Routes
with JWT Middleware
5:03 - 6. Role-Based Authorization
Middleware
5:45 - 7. Applying Middleware to Routes
7:03 - 8. Putting it all together
7:36 - 8.1. Adding New Path Aliases
8:06 - 8.2. Adding Type Definitions
9:13 - 8.3. dotenv.config()
9:42 - 9. Testing the Routes
11:32 - 10. Outro

#NodeJS #JWT #Authentication #EnvironmentVariables #Dotenv #TypeScript #WebSecurity #JSONWebToken #WebDevelopment #BackendDevelopment #JavaScript #CodingTutorial #APISecurity #expressjs