Making progress on rewrite. Looking into supabase cache helpers.

This commit is contained in:
2025-06-23 16:59:02 -05:00
parent 63574f0729
commit 13cf089870
21 changed files with 740 additions and 13 deletions

24
src/middleware.ts Normal file
View File

@@ -0,0 +1,24 @@
import { type NextRequest } from 'next/server';
import { updateSession } from '@/utils/supabase/middleware';
import { banSuspiciousIPs } from '@/utils/ban-suspicious-ips';
export const middleware = async (request: NextRequest) => {
const banResponse = banSuspiciousIPs(request);
if (banResponse) return banResponse;
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)
* - /monitoring-tunnel (Sentry monitoring)
* - images - .svg, .png, .jpg, .jpeg, .gif, .webp
* Feel free to modify this pattern to include more paths.
*/
'/((?!_next/static|_next/image|favicon.ico|monitoring-tunnel|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
],
};