Closed hi-ogawa closed 3 months ago
https://nextjs.org/docs/app/api-reference/file-conventions/middleware
It's probably straight-forward. But, I would expect actually integrating things like next-auth is harder.
next-auth
Probably the hard part is to implement NextResponse.next api?
NextResponse.next
Indeed, next-auth would need those https://github.com/nextauthjs/next-auth/blob/a3d3d4bab3e037a5359ed22de8b1fff0b5557523/packages/next-auth/src/lib/index.ts#L2-L3
import { headers } from "next/headers.js" import { NextResponse } from "next/server.js"
Also, our current flight data convention (path)__f.data might cause some trouble with this (cf. https://github.com/hi-ogawa/vite-plugins/pull/374).
(path)__f.data
Closed by https://github.com/hi-ogawa/vite-plugins/pull/553
https://nextjs.org/docs/app/api-reference/file-conventions/middleware
It's probably straight-forward. But, I would expect actually integrating things like
next-auth
is harder.Probably the hard part is to implement
NextResponse.next
api?Indeed,
next-auth
would need those https://github.com/nextauthjs/next-auth/blob/a3d3d4bab3e037a5359ed22de8b1fff0b5557523/packages/next-auth/src/lib/index.ts#L2-L3Also, our current flight data convention
(path)__f.data
might cause some trouble with this (cf. https://github.com/hi-ogawa/vite-plugins/pull/374).