That code is config. Zero-config would be that those middlewares are enabled by default, so you have to do zero things to enable it. I guess maybe there is a difference in understanding the terminology. I always understood zero-config to be that you'd have to do nothing to get that particular feature, but maybe zero in zero-config is referring to something else.
Next is a lightweight framework. It doesn't implement authentication for you. It's up to you to implement it, but the scaffolding is there for you to easily do it.
You're arguing against your initial comment:
> Feels like all tooling starts out with "We're simple, no config or code needed!" and eventually ends up so extensible that it's hard to figure out how to even use it.
The point of Next.js is that the framework functionality is minimal. You learn the basic concepts and then build the rest out yourself. If they built all of these middlewares into the framework, then we would be in that state you're complaining about since now you have to learn how to use their specific implementation of that middleware because god knows their implementation won't work for your specific needs.
Next.js takes care of everything but the application code itself. It's a true framework.
> Zero-config would be that those middlewares are enabled by default
What middlewares? Next has all basic middlewares needed enabled by default. What you're suggesting is that Next ships with every possible middleware that anyone could need, even the special snowflake middleware I want that adds a "foozlebozzle" property to the request context, just to say "We don't require you to do anything" and that's just not possible.
They have made it so you can hook into things and customize if needed, not "you have to now write all your own middleware for everything"
Yes, it is a good thing but I do not see how it is zero config (and generally I do not think zero config is a good thing). Selecting your set of middleware is config.
The zero-config aspect is that in order to add my own middleware to my app, I drop in a file with my middleware function into a directory and that's it. There is nothing else I have to do. Just like if I want to define a new API endpoint, I drop in a file in the corresponding directory with the endpoint function defined and that's it. That's zero config.
They took all the ease of the old PHP approach and made it better.