Migrate to local PG & Update Solana Checkout

This commit is contained in:
2026-03-12 19:22:10 +03:00
parent e7f9325b1c
commit 321f25a15c
16 changed files with 1445 additions and 4980 deletions

View File

@@ -1,20 +1,19 @@
import { type NextRequest } from 'next/server'
import { updateSession } from '@/utils/supabase/proxy'
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export async function proxy(request: NextRequest) {
return await updateSession(request)
export function proxy(request: NextRequest) {
const adminSession = request.cookies.get('admin_session');
// Protect /admin routes
if (request.nextUrl.pathname.startsWith('/admin')) {
if (!adminSession) {
return NextResponse.redirect(new URL('/login', request.url));
}
}
return NextResponse.next();
}
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)
* - public files (images, etc)
* Feel free to modify this pattern to include more paths.
*/
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
],
}
matcher: ['/admin/:path*'],
};