()
| 3 | import { cookies } from "next/headers" |
| 4 | |
| 5 | export async function createClient() { |
| 6 | const cookieStore = await cookies() |
| 7 | return createServerClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, { |
| 8 | cookies: { |
| 9 | getAll() { |
| 10 | return cookieStore.getAll() |
| 11 | }, |
| 12 | setAll(cookiesToSet) { |
| 13 | try { |
| 14 | cookiesToSet.forEach(({ name, value, options }) => cookieStore.set(name, value, options)) |
| 15 | } catch { |
| 16 | // The `setAll` method was called from a Server Component. |
| 17 | // This can be ignored if you have middleware refreshing |
| 18 | // user sessions. |
| 19 | } |
| 20 | }, |
| 21 | }, |
| 22 | }) |
| 23 | } |
| 24 | |
| 25 | export async function getServerToken() { |
| 26 | const supabase = await createClient() |
no outgoing calls
no test coverage detected