Thank you. The post you linked provided the correct clue. It is now necessary to pass the request object to getSession
:
export async function middleware(request: NextRequest) {
...
const session = await auth0.getSession(request);
...
}