- Implement server-side session revocation on logout - Add IP extraction utility and admin setup error handling - Improve error codes and response consistency for auth endpoints - Refine landing page redirect logic to handle transient DB outages - Update deployment documentation and configuration defaults
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { MainLayout } from '@/components/layout/MainLayout';
|
|
import { Features } from '@/components/sections/Features';
|
|
import { Hero } from '@/components/sections/Hero';
|
|
import { LandingAbout } from '@/components/sections/LandingAbout';
|
|
import { SdkSection } from '@/components/sections/SdkSection';
|
|
import { isAdminSetupComplete } from '@/core/auth/adminUsers';
|
|
import { redirect } from 'next/navigation';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export default async function LandingPage() {
|
|
try {
|
|
const isConfigured = await isAdminSetupComplete();
|
|
if (!isConfigured) redirect('/vcon/setup');
|
|
} catch (error) {
|
|
if (
|
|
error &&
|
|
typeof error === 'object' &&
|
|
'digest' in error &&
|
|
String((error as { digest?: unknown }).digest).startsWith('NEXT_REDIRECT')
|
|
) {
|
|
throw error;
|
|
}
|
|
// Keep public landing accessible on transient DB outage instead of redirecting to setup
|
|
}
|
|
|
|
return (
|
|
<MainLayout>
|
|
<Hero />
|
|
<Features />
|
|
<SdkSection />
|
|
<LandingAbout />
|
|
</MainLayout>
|
|
);
|
|
}
|