Nextjs v4 Migration

Hi @rueben.tiow – the answers are there is you look into the Github issues and community discusions, but that’s bit more work than using a template reply in the community forum.

Let’s start with the most obvious one, v3 to v4 is almost a complete API rewrite on how Auth0 integrates with Next.js while having ~240 lines migration guide on GH.
You are basically deprecating both the API routes (in favor of middleware) and removing most of the utility methods for checking active sessions. Any customization around the Auth0 flow has to be completely re-writen.

On top of that, this update is a blocker for Next.js v14 to v15 migration – with no migration path or utilities in sight. So, a few suggestions:

  • Update the library be Next.js v14 compatible, so gradual migration is possible
  • Provide more details around getSession changes, and how to migrate over in both app router and pages router
  • Provide the withPageAuthRequired and withApiAuthRequired utilities back with a deprecated flag
  • Provide clarity around API route customisation when using middleware instead of a catch-all route

To support @bernd.strehl point – this has to be one of the most under-engineered package update I’ve encountered in a while.