Module 09 of 10

Authentication & Security

Lessons

About This Module

Authentication answers who is this user? and authorization answers what are they allowed to do? In the App Router, those decisions belong on the server: check the session in Server Components, Server Actions and Route Handlers, and use middleware to redirect unauthenticated visitors before a protected page renders. Hiding a button in the UI is never enough on its own.

This module starts with the foundations, sessions, cookies and JWTs, and then moves to Auth.js (formerly NextAuth), which builds on those ideas with OAuth providers, credentials login, and route protection. Auth libraries change quickly between major versions, so treat the videos as a guide to the concepts and check the current Auth.js docs for exact setup.

Watch the lessons in order, then continue on to Testing, Deployment & Performance.

Lessons

4 videos
01

Next.js App Router Authentication (Sessions, Cookies, JWTs)

The foundations of session-based authentication through cookies in the App Router, and how libraries like Auth.js build on top of them.

02

NextJS 14 - Authentication using Next Auth / Auth.js [Complete Guide]

A complete guide to authentication in the Next.js 14 App Router using Next Auth, also known as Auth.js.

03

Next-Auth V5 Tutorial (OAuth, Email, Server Actions, Server-Side Auth, Client-Side Auth, Roles)

Sets up Auth.js 5 in a Next.js project and covers OAuth, email login, server-side and client-side auth checks, and roles.

04

Learn Next-Auth Login Authentication - with Next.js App Router

Protects routes with Next Auth and the App Router in a complete React movie application.