need help with customizing error page if auth is failed
hey folks I'm using
next-auth
NextJs 14 with app router can anyone tell me how can I customize the default error page if the auth is failed7 Replies
Hey I think you can set it in authoOptions as
pages: {
signIn: "/login",
error:<path to page>
//newUser: "/onboarding",
},
more info - https://next-auth.js.org/configuration/pages
Pages | NextAuth.js
NextAuth.js automatically creates simple, unbranded authentication pages for handling Sign in, Sign out, Email Verification and displaying error messages.
ok I will try
I triedd it but it didn't worked
I created a new page in the app directory like this
oauth/auth-failed/page.tsx
and then in next-auth options I put this
and after saving the next-auth file when I tried to login and cancel the login it gone back to the homepage not the error pagewas there a error thrown by next auth?
yeah next-auth did throw an error when I canceled the authorizaion it was this error
umm tbh not sure then
Then what