Skip to content

Commit

Permalink
fix: skip tokens in admin db calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Balastrong committed Sep 11, 2024
1 parent 977b5b6 commit 55ed15c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib/supabase/serverAdmin.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import { createServerClient } from "@supabase/ssr"
import { cookies } from "next/headers"
import { Database } from "./types.gen"

export function createAdminClient() {
const cookieStore = cookies()

return createServerClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.SUPABASE_SERVICE_KEY ??
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
getAll() {
return cookieStore.getAll()
},
setAll(cookiesToSet) {
cookiesToSet.forEach(({ name, value, options }) =>
cookieStore.set(name, value, options),
)
return []
},
},
},
Expand Down

0 comments on commit 55ed15c

Please sign in to comment.