Files
supabase/examples/auth/nextjs/middleware.ts
Peter 476542f86d Update Supabase Bootstrap NextJS example to use new SSR methods (#28241)
* Update NextJS example to use new SSR methods

* Remove Debug message

* Double quote imports and set supabase package versions to latest

* missed a file
2024-08-02 18:15:35 -05:00

20 lines
604 B
TypeScript

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