fix: Implement unified authentication system

- Created single auth-unified.ts module as the source of truth
- Deprecated old auth.ts and simple-auth.ts (now proxy to unified)
- Fixed dashboard SSR auth using Astro.cookies for better compatibility
- Added comprehensive auth test page at /auth-test-unified
- Resolved cookie handling issues in Docker environment

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-12 20:31:01 -06:00
parent e48fdc9691
commit 76d27590fb
9 changed files with 604 additions and 449 deletions

View File

@@ -6,12 +6,11 @@ import { verifyAuth } from '../lib/auth';
// Enable server-side rendering for auth checks
export const prerender = false;
// Disable server-side auth check temporarily to fix redirect loop
// We'll handle auth check on the client side in the script section
// const auth = await verifyAuth(Astro.request);
// if (!auth) {
// return Astro.redirect('/login');
// }
// Server-side auth check using cookies for better SSR compatibility
const auth = await verifyAuth(Astro.cookies);
if (!auth) {
return Astro.redirect('/login');
}
---
<Layout title="Dashboard - Black Canyon Tickets">