From 9a47ddb2ebe315e6a73d36b052c9a4df5d6f26e6 Mon Sep 17 00:00:00 2001 From: rikhall1515 <30295873+rikhall1515@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:08:42 +0200 Subject: [PATCH] feat(db): add supabase middleware --- middleware.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 middleware.ts diff --git a/middleware.ts b/middleware.ts new file mode 100644 index 0000000..257b419 --- /dev/null +++ b/middleware.ts @@ -0,0 +1,21 @@ +import { type NextRequest } from "next/server"; + +import { updateSession } from "@/db/middleware"; + +export async function middleware(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)$).*)", + ], +};