()
| 10 | * cookie-based session auth. |
| 11 | */ |
| 12 | export async function createClient() { |
| 13 | const cookieStore = await cookies(); |
| 14 | |
| 15 | return createServerClient( |
| 16 | process.env.NEXT_PUBLIC_SUPABASE_URL!, |
| 17 | process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!, |
| 18 | { |
| 19 | cookies: { |
| 20 | getAll() { |
| 21 | return cookieStore.getAll(); |
| 22 | }, |
| 23 | setAll(cookiesToSet) { |
| 24 | try { |
| 25 | for (const { name, value, options } of cookiesToSet) { |
| 26 | cookieStore.set(name, value, options); |
| 27 | } |
| 28 | } catch { |
| 29 | // The `setAll` method was called from a Server Component. |
| 30 | // This can be ignored if you have middleware refreshing |
| 31 | // user sessions. |
| 32 | } |
| 33 | }, |
| 34 | }, |
| 35 | }, |
| 36 | ); |
| 37 | } |
no outgoing calls
no test coverage detected