You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Next.js 14, API routes use the Request object from the Web API, which provides a json() method for parsing request bodies. However, when integrating NextAuth's getServerSession in these API routes, there is an inconsistency because getServerSession requires NextApiRequest and NextApiResponse objects, which are specific to Next.js's traditional API routes.
This causes a conflict when trying to access session details using getServerSession in the new API routes. Developers are forced to either switch back to NextApiRequest and NextApiResponse, losing the benefits of the modern Web API Request, or find a workaround, which complicates the development process.