What NextAuth.js Does

NextAuth.js is the established name for the Next.js integration of Auth.js. It handles provider sign-in flows, callback endpoints, CSRF protections, cookies, and session retrieval. It does not automatically implement registration, password resets, your user database, roles, or application-specific permissions.

This tutorial's runnable main path targets NextAuth v4 with the Pages Router (pages/). It demonstrates Google OAuth and a Credentials provider that delegates password verification to a trusted backend. A later chapter explains v5/App Router differences.