chore: init monorepo snapshot

This commit is contained in:
liaibo
2025-11-23 10:55:04 +08:00
commit c70ff52869
941 changed files with 246586 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { createClientComponentClient } from "@supabase/auth-helpers-nextjs";
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
if (!supabaseUrl || !supabaseAnonKey) {
throw new Error("缺少 Supabase 环境变量,请在 .env.local 配置 NEXT_PUBLIC_SUPABASE_URL 与 NEXT_PUBLIC_SUPABASE_ANON_KEY");
}
export const supabaseBrowser = createClientComponentClient({
supabaseUrl,
supabaseKey: supabaseAnonKey,
});
+16
View File
@@ -0,0 +1,16 @@
import { createServerComponentClient, createRouteHandlerClient } from "@supabase/auth-helpers-nextjs";
import { getDecodedCookies } from "@/lib/server-cookies";
export const createSupabaseServerClient = async () => {
const cookieStore = await getDecodedCookies();
return createServerComponentClient({
cookies: () => cookieStore,
});
};
export const createSupabaseRouteClient = async () => {
const cookieStore = await getDecodedCookies();
return createRouteHandlerClient({
cookies: () => cookieStore,
});
};