fix: Resolve Supabase SSR cookie handling and auth test page issues

- Add null checks for cookies object in Supabase SSR client
- Fix auth test page to use Astro.cookies instead of Astro.request
- Prevent "Cannot read properties of undefined" errors in cookie handling
- Ensure proper unified auth usage pattern in test pages

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-12 21:01:43 -06:00
parent 2ec8baf1de
commit d76229478d
2 changed files with 5 additions and 2 deletions

View File

@@ -12,12 +12,15 @@ export function createSupabaseServerClient(
{
cookies: {
get(name: string) {
if (!cookies) return undefined;
return cookies.get(name)?.value
},
set(name: string, value: string, options: CookieOptions) {
if (!cookies) return;
cookies.set(name, value, options)
},
remove(name: string, options: CookieOptions) {
if (!cookies) return;
cookies.delete(name, options)
},
},