Initial working state: CL3.5 complete (Plesk sync + suspend/unsuspend)
This commit is contained in:
13
lib/supabase/admin.ts
Normal file
13
lib/supabase/admin.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
|
||||
import { env } from "@/lib/env";
|
||||
import type { Database } from "@/lib/types";
|
||||
|
||||
export function createSupabaseAdminClient() {
|
||||
return createClient<Database>(env.supabaseUrl, env.supabaseServiceRoleKey, {
|
||||
auth: {
|
||||
autoRefreshToken: false,
|
||||
persistSession: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
9
lib/supabase/browser.ts
Normal file
9
lib/supabase/browser.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { createClientComponentClient } from "@supabase/auth-helpers-nextjs";
|
||||
|
||||
import type { Database } from "@/lib/types";
|
||||
|
||||
export function createSupabaseBrowserClient() {
|
||||
return createClientComponentClient<Database>();
|
||||
}
|
||||
8
lib/supabase/route.ts
Normal file
8
lib/supabase/route.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import type { Database } from "@/lib/types";
|
||||
|
||||
export function createSupabaseRouteClient() {
|
||||
return createRouteHandlerClient<Database>({ cookies });
|
||||
}
|
||||
8
lib/supabase/server.ts
Normal file
8
lib/supabase/server.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createServerComponentClient } from "@supabase/auth-helpers-nextjs";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import type { Database } from "@/lib/types";
|
||||
|
||||
export function createSupabaseServerClient() {
|
||||
return createServerComponentClient<Database>({ cookies });
|
||||
}
|
||||
Reference in New Issue
Block a user