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:
@@ -17,11 +17,21 @@ export function createSupabaseServerClient(
|
||||
},
|
||||
set(name: string, value: string, options: CookieOptions) {
|
||||
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) {
|
||||
if (!cookies) return;
|
||||
cookies.delete(name, options)
|
||||
cookies.delete(name, {
|
||||
...options,
|
||||
path: '/'
|
||||
})
|
||||
},
|
||||
},
|
||||
cookieOptions,
|
||||
|
||||
Reference in New Issue
Block a user