Files
Jon Meyers fc4f062ba9 Chore: Update with-supabase example to Next.js 16 (#86105)
### What?

Upgrade with-supabase example to be compatible with Next.js 16

### Why?

1. Users get console warnings about middleware vs proxy
2. Enabling Cache Components config results in build errors for async
behaviour outside Suspense boundary
3. Turbopack flag is default and therefore, no longer necessary on `npm
run dev`

### How?

1. Renamed all instances of `middleware` to `proxy`
2. Wraped async behaviour in Suspense boundaries
3. Removed --turbopack flag from `npm run dev`

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-11-17 22:41:21 -08:00

21 lines
624 B
TypeScript

import { updateSession } from "@/lib/supabase/proxy";
import { type NextRequest } from "next/server";
export async function proxy(request: NextRequest) {
return await updateSession(request);
}
export const config = {
matcher: [
/*
* Match all request paths except:
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
* - images - .svg, .png, .jpg, .jpeg, .gif, .webp
* Feel free to modify this pattern to include more paths.
*/
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
],
};