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.
Auth layout and sign-in page - Next.js Tutorial
From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Auth layout and sign-in page
So now we're going to start to work on the sign-in page, but I want to have a separate layout for both the sign-in and the sign-up pages, because they're going to have a narrow box in the middle. So what we'll do is create a new group. So in the app folder, in addition to root, we're going to have a folder with parentheses called auth. Now, this auth doesn't get added to the route. This doesn't mean slash auth. That's not what that means, because it has parentheses. So it's not treated as part of the route. It's just a group and a way to organize things. And in that auth, we're going to create a new layout.tsx file. And in that, let's just copy from the root layout. So I'll just grab all this stuff here. And let's paste that in the auth layout. And we can change the name of this as well. So instead of root, we can call this off layout. And it's going to take in children. We're not going to have the header. We're not going to have the footer. And then what I do want to have is just a…
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)
-
-
-
-
-
-
-
-
-
-
-
-
-