Spaces:
Runtime error
Runtime error
Download apps/web/src/utils/supabase/server.ts from Oheha/cybully-api: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/spaces/Oheha/cybully-api/resolve/main/apps/web/src/utils/supabase/server.ts
- Command line
-
hf download hf://spaces/Oheha/cybully-api/apps/web/src/utils/supabase/server.ts
-
curl -L -o server.ts https://huggingface.co/spaces/Oheha/cybully-api/resolve/main/apps/web/src/utils/supabase/server.ts
695 Bytes
| import { createServerClient } from "@supabase/ssr"; | |
| import { cookies } from "next/headers"; | |
| export function createClient() { | |
| const cookieStore = cookies(); | |
| return createServerClient( | |
| process.env.NEXT_PUBLIC_SUPABASE_URL!, | |
| process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!, | |
| { | |
| cookies: { | |
| getAll() { | |
| return cookieStore.getAll(); | |
| }, | |
| setAll(cookiesToSet) { | |
| try { | |
| cookiesToSet.forEach(({ name, value, options }) => { | |
| cookieStore.set(name, value, options); | |
| }); | |
| } catch { | |
| // Server Components can't always persist cookies directly. | |
| } | |
| } | |
| } | |
| } | |
| ); | |
| } | |