-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Route Handlers in the app
folder of Nextjs 13
#6792
Comments
There is already a PR for it, and you can find an experimental version here #6777 (comment) to try it out! Note, It's more of an incremental/gradual migration over a longer time period, API Routes are not "replaced". |
This is great! Do you know when (approximately) this will make it to the next official release? |
I would like to get this released maybe next week, if not sooner. |
@balazsorban44 I tried the latest code from #6777 (comment) today.
I get the google's consent screen first, and after I give my consent I get redirected to the callback but with the error. Not quite sure what this is. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Small blocker I encountered, there seems to be an issue with setting multiple cookies. Currently, I suspect it's in Next.js, investigating. Related: vercel/next.js#38302 (comment) All of your reports are likely related to that. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@balazsorban44 Do I understand correctly that the fix for this ticket depends on vercel/next.js#46355? |
Yes, see: #6792 (comment) That issue you linked is more correct to link to though, so thanks. 👍 |
to resolve this temporarily, setting |
Hi @balazsorban44, sorry for the late reply. Here is the reproduction repo as you requested in #6777 (comment): https://github.com/EliasGcf/next-auth-with-route-handler |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Thank you for everyone's patience, this is now available in Remember, this is opt-in, |
Even though I can correctly source my provider configuration from api/auth/[...nextauth].ts I get an API resolver error unless I define the same NextAuth settings in pages/api/auth/[...nextauth].ts This happens when I trigger the signIn callback from next-auth/react Does anyone have a similar issue? Or anyone have tips on how to debug / resolve this problem? |
In App Router, Route Hanlders must be defined at file named |
I tried the above but still get the same issue. Putting the following in
Putting it in
Both fail for me unless I explicitly define them in the |
|
./api/auth/[...nextauth]/route.js actually works, ty! |
I have tried Only the |
I also found a great guide which was made just 10 days ago https://youtu.be/VE8BkImUciY?t=8085 |
The issue was caused by a redirect regex on the backend. |
Found & resolved an issue on my end; |
For those that deployed their app on the Cloud and use a custom base path, refer to https://next-auth.js.org/getting-started/client#custom-base-path. Was a major headache on my Next.js 14.2 app |
Description 📓
TL;DR
Need support for setting up NextAuth in route handler.
Details
As API routes being replaced by Route handlers (https://beta.nextjs.org/docs/routing/route-handlers) NextAuth need to support running in the
route handler
.And documentation need to provide an example how to setup the nextjs authentication with NextAuth that uses route handler instead of the API route
pages/api/auth/[...nextauth].ts
How to reproduce ☕️
N/A
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
The text was updated successfully, but these errors were encountered: