diff --git a/src/components/ProtectedRoute.astro b/src/components/ProtectedRoute.astro index 158629c..d8604e9 100644 --- a/src/components/ProtectedRoute.astro +++ b/src/components/ProtectedRoute.astro @@ -1,5 +1,8 @@ --- -// Simple protected route component +// DEPRECATED: Protected route component - now handled server-side +// This component no longer performs authentication checks. +// All authentication is handled by the unified auth system at the server level. + export interface Props { title?: string; requireAdmin?: boolean; @@ -8,135 +11,13 @@ export interface Props { const { title = "Protected Page", requireAdmin = false } = Astro.props; --- +
- - \ No newline at end of file + // Note: Authentication is now handled server-side by the unified auth system. + // This component is kept for backwards compatibility but no longer performs auth checks. + console.log('[PROTECTED] ProtectedRoute mounted - auth handled server-side'); + \ No newline at end of file diff --git a/src/pages/onboarding/organization.astro b/src/pages/onboarding/organization.astro index 7fa27e0..dbd3ab9 100644 --- a/src/pages/onboarding/organization.astro +++ b/src/pages/onboarding/organization.astro @@ -1,6 +1,16 @@ --- import SecureLayout from '../../layouts/SecureLayout.astro'; import ProtectedRoute from '../../components/ProtectedRoute.astro'; +import { verifyAuth } from '../../lib/auth-unified'; + +// Enable server-side rendering for auth checks +export const prerender = false; + +// Server-side authentication check +const auth = await verifyAuth(Astro.cookies); +if (!auth) { + return Astro.redirect('/login'); +} ---