Help Me make a custom login Page

I'm using Credential Provider for nextAuth I want to customise my login page
4 Replies
Neto
Neto14mo ago
Pages | NextAuth.js
NextAuth.js automatically creates simple, unbranded authentication pages for handling Sign in, Sign out, Email Verification and displaying error messages.
Neto
Neto14mo ago
// To add a custom login page, you can use the pages option:

// pages/api/auth/[...nextauth].js

pages: {
signIn: '/auth/signin',
signOut: '/auth/signout',
error: '/auth/error', // Error code passed in query string as ?error=
verifyRequest: '/auth/verify-request', // (used for check email message)
newUser: '/auth/new-user' // New users will be directed here on first sign in (leave the property out if not of interest)
}
// To add a custom login page, you can use the pages option:

// pages/api/auth/[...nextauth].js

pages: {
signIn: '/auth/signin',
signOut: '/auth/signout',
error: '/auth/error', // Error code passed in query string as ?error=
verifyRequest: '/auth/verify-request', // (used for check email message)
newUser: '/auth/new-user' // New users will be directed here on first sign in (leave the property out if not of interest)
}
l
l14mo ago
How would u send user back to the path, user come from. Lets say user u login from cart how to send him back to the cart?
Neto
Neto14mo ago
when redirecting from the sign in page, add the old path, (/cart) as example, as a query param after successfully signin, just send back to the old path