Full Stack Authentication with Next-Auth and Next.js 13: All You Need to Know

❤️Please Support me by subscribing to this channel 👉🏻https://www.youtube.com/@sakuradev?sub_confirmation=1

In this YouTube 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.

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

🤩Also Watch:
Adding Google Provider to Next Auth: https://youtu.be/A53T9_V8aFk

Update Next Auth Session: https://youtu.be/gDsCueKkFEk

Refresh Token: https://youtu.be/RPl0r-Yl6pU

How to Save Backend JWTs in Next Auth Session: https://youtu.be/fYObrr3jf0w

Custom Login Page with Next Auth: https://youtu.be/hADeo48SATU

📖 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