The first commit, the core and all files is adding to repo

This commit is contained in:
2026-10-04 14:20:13 +05:00
commit 53d7b263c4
94 changed files with 10668 additions and 0 deletions

32
proxy.ts Normal file
View File

@@ -0,0 +1,32 @@
import { createServerClient } from "@supabase/ssr";
import { NextRequest, NextResponse } from "next/server";
export async function proxy(request: NextRequest) {
let response = NextResponse.next({ request });
if (!process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY) return response;
const client = createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY,
{
cookies: {
getAll: () => request.cookies.getAll(),
setAll: (values) => {
values.forEach(({ name, value }) => request.cookies.set(name, value));
response = NextResponse.next({ request });
values.forEach(({ name, value, options }) =>
response.cookies.set(name, value, options),
);
},
},
},
);
await client.auth.getUser();
return response;
}
export const config = {
matcher: [
"/dashboard/:path*",
"/moderation/:path*",
"/pair",
"/api/v1/:path*",
],
};