Skip to main content
CourseFlix

NestJS Authentication + Refresh Token With Passport.js

2h 29m 25s
English
Paid

In this lesson, you add JWT auth to a NestJS app. You also set up refresh tokens. These tokens help you keep users logged in without a new login each time.

What You Build

You link a NestJS backend to a Next.js client. You protect routes with custom middleware. You also add Google OAuth for quick sign‑in. Each part works together to form a clear auth flow.

Key Steps

  • Create JWT access and refresh tokens.
  • Store and check refresh tokens in the backend.
  • Protect routes with Passport.js guards.
  • Use Google OAuth for a simple login option.
  • Connect these features to a Next.js front end.

Why It Matters

This setup gives your app safe login behavior. You learn how to handle tokens, guard routes, and link auth across services. These skills help you build full‑stack apps that users can trust.

Additional

  • Backend: https://github.com/mguay22/nestjs-social-auth-refresh
  • UI: https://github.com/mguay22/nextjs-social-auth-refresh

About the Author: Michael Guay

Michael Guay thumbnail

Michael Guay is a professional full-stack engineer with over 10 years of experience in developing enterprise software. He works in the fintech sector, specializing in high-performance backend systems, microservices, and modern frontend. On his YouTube channel (24k+ subscribers) and on Udemy, he shares knowledge on topics such as NestJS, tRPC, Next.js, and full-stack development. On his website, he publishes practical case studies: architecture, performance, and system deployment.

Watch Online 1 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 1 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: NestJS Authentication + Refresh Token With Passport.js
All Course Lessons (1)
#Lesson TitleDurationAccess
1
NestJS Authentication + Refresh Token With Passport.js Demo
02:29:25
Unlock unlimited learning

Get instant access to all 0 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription