From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Section intro

Section intro

Alright guys, so now we're going to get into authentication, which we're using NextAuth for. And NextAuth is definitely what I would suggest for pretty much every Next.js app. Well, I can't say every, but most, in most situations, because it just offers so many different ways to log in, so many different providers, whether it's Google, GitHub, Twitter, or what we're going to do, just using a local JWT strategy. So we'll just have users register with an e-mail and a password, and then they'll be able to log in with that e-mail and password. And of course, we'll be using bcrypt to hash passwords. And I'm going to go over how the whole flow of authentication works in a second, but let's just look at the videos or the lessons that we're going to do in this section. So we're going to start off by creating our models. We're going to have a user model, an account model, a session model. Then we're going to seed some user data. So right now, we have a product seeder, but we're going to add…

Contents