fix: Configure Supabase SSR cookies for Docker/localhost environment

- Set secure: false for localhost (non-HTTPS) environment
- Configure sameSite: 'lax' to allow cookie transmission
- Ensure path: '/' for site-wide cookie access
- Maintain httpOnly: true for security

This should resolve session persistence issues in Docker containers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-12 21:10:50 -06:00
parent 45c0a052ad
commit 03e3d8241c

View File

@@ -17,11 +17,21 @@ export function createSupabaseServerClient(
}, },
set(name: string, value: string, options: CookieOptions) { set(name: string, value: string, options: CookieOptions) {
if (!cookies) return; if (!cookies) return;
cookies.set(name, value, options) // Fix cookie settings for Docker/production
cookies.set(name, value, {
...options,
httpOnly: true,
secure: false, // Set to false for Docker/localhost
sameSite: 'lax',
path: '/'
})
}, },
remove(name: string, options: CookieOptions) { remove(name: string, options: CookieOptions) {
if (!cookies) return; if (!cookies) return;
cookies.delete(name, options) cookies.delete(name, {
...options,
path: '/'
})
}, },
}, },
cookieOptions, cookieOptions,