Custom signing page is not showing

I am getting this in my Console API handler should not return a value, received object. API resolved without sending a response for /api/auth/signin, this may result in stalled requests I have this in my NextAuthOptions
pages: {
signIn: 'auth/signin',
},
pages: {
signIn: 'auth/signin',
},
the sign in page code and auth code https://paste.gg/p/anonymous/173ab04474924eaa93dfc7a1dceefab1

 file structure the screenshot
Solution:
The issue might be is that auth/signin is not a page, its a API route. What you probably want to do is create a page starting with auth then a subdirectory with signin if you want that to be the url. I'm using the app router, but the structure is the same, you can disregard the (auth), it doesn't add anything to the url it just groups the page routes. That is why I just use /signin and not /auth/signin from the nextauth config.
No description
Jump to solution
7 Replies
Solution
Alan Ibarra-2310
Alan Ibarra-231016mo ago
The issue might be is that auth/signin is not a page, its a API route. What you probably want to do is create a page starting with auth then a subdirectory with signin if you want that to be the url. I'm using the app router, but the structure is the same, you can disregard the (auth), it doesn't add anything to the url it just groups the page routes. That is why I just use /signin and not /auth/signin from the nextauth config.
No description
gave_one
gave_oneOP16mo ago
@jovonni CredentialsProvider it's not creating the user https://paste.gg/p/anonymous/585a35cb48ec45eabbbd564f811a3faf
Alan Ibarra-2310
Alan Ibarra-231016mo ago
Ok, I misunderstood your question. I think its a problem with how your are returning your handler. There are a couple open discussions for this issue and they all are revolved around removing the return from the handler.
const authHandler = NextAuth(authOptions);

export default async function handler(...params) {
// No return here
await authHandler(...params);
}
const authHandler = NextAuth(authOptions);

export default async function handler(...params) {
// No return here
await authHandler(...params);
}
https://github.com/nextauthjs/next-auth/issues/7963 https://github.com/vercel/next.js/discussions/48951 https://stackoverflow.com/questions/76547978/next-auth-gives-error-on-sign-in-api-handler-should-not-return-a-value-receiv
GitHub
Next 13.4 denies returning values from API handlers · Issue #7963 ·...
Environment Reproduction URL https://github.com/nextauthjs/next-auth/tree/main Describe the issue New NextJS shows this notification API handler should not return a value, received object. How to r...
GitHub
Console warning: API handler should not return a value · vercel n...
Summary I've recently started receiving API handler should not return a value, received object. errors, which (thanks to GitHub's amazing "search everything everywhere all at once"...
Stack Overflow
Next-Auth gives error on sign in: "API handler should not return a ...
I'm using [email protected] with [email protected] and Typescript. Whenever I use the signIn() function, it goes through sign in as normal, but then print the following line to the server's console: API h...
gave_one
gave_oneOP16mo ago
those conversations didn't really help me. It's just me more confused
gave_one
gave_oneOP16mo ago
and also how can I implement this? What is inside ...params
gave_one
gave_oneOP16mo ago
@jovonni
Want results from more Discord servers?
Add your server