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.