Update supabase server to secure and http only

This commit is contained in:
Nate Kelley 2025-01-23 16:37:44 -07:00
parent 15e515720f
commit 02d0f9f2c4
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { createServerClient, type CookieOptions } from '@supabase/ssr'; import { createServerClient } from '@supabase/ssr';
import { cookies } from 'next/headers'; import { cookies } from 'next/headers';
export async function createClient() { export async function createClient() {
@ -8,6 +8,14 @@ export async function createClient() {
process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{ {
cookieOptions: {
secure: true,
httpOnly: true
},
auth: {
autoRefreshToken: true,
persistSession: true
},
cookies: { cookies: {
getAll() { getAll() {
return cookieStore.getAll(); return cookieStore.getAll();