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 - Next.js Tutorial
From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Section intro2m 57s
-
(Locked)
Prisma user-related models9m 45s
-
(Locked)
Seed user data7m
-
(Locked)
NextAuth setup17m 31s
-
(Locked)
NextAuth catch all API route4m 12s
-
(Locked)
Sign-in and sign-out server actions8m 27s
-
(Locked)
Auth layout and sign-in page6m 58s
-
(Locked)
Credentials sign-in form6m 39s
-
(Locked)
Hook up sign-in form9m 28s
-
(Locked)
Callback URL redirect4m 26s
-
(Locked)
User button and sign-out11m 48s
-
(Locked)
Signup Zod schema and action8m 15s
-
(Locked)
Sign-up page and form7m 35s
-
(Locked)
Sign-up error handling12m 40s
-
(Locked)
Customize token with JWT callback8m 19s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-