In this video, you'll learn how to implement full-stack authentication using Next.js 13 and Next-Auth. You'll start by integrating Next-Auth with Next.js 13 within your app directory and then set up a database using Prisma. Next, you'll protect pages with Next-Auth middleware and secure APIs with JWT. By the end of this tutorial, you'll have a solid understanding of how to implement secure authentication for your Next.js 13 application using Next-Auth and Prisma. Whether you're a beginner or an experienced developer, this video will provide you with valuable insights on how to build secure and robust applications.

📖 Content
0:00 Intro
0:59 Setup next-auth in app dir
6:46 Setup prisma with next.js
10:24 Create login API
13:27  How to check hashed  passwords
16:00 Using login API in Authorize function
17:36 Create user register API
19:26 Hash the password of new user
24:44 What is Next-Auth Session?
27:06 Create SignIn button
32:43 Strategies for keeping next-auth session
38:57 Protect pages with next-auth middleware
42:22 Why we need JWT to protect APIs
46:54 Create JWT Access Token in login API
55:41 How to save Access Token inside next-auth session
59:36 Protect API with JWT Access Token

GitHub repo (don't forget to give it a ⭐ ) :  https://github.com/vahid-nejad/next-auth-fullstack 

Subscribe: https://www.youtube.com/@SakuraDev/featured 

#nextjs #javascript #react 

How to Implement Full-Stack Authentication using Next.js 13 and Next-Auth
2.45 GEEK