import type { Metadata } from 'next'; import { redirect } from 'next/navigation'; import { isInstalled, getInstallCredentials, getSetupToken, validateSetupToken, } from '@/lib/install'; import { InstallWizard } from './InstallWizard'; export const metadata: Metadata = { title: 'Install Immich Folio', robots: { index: false, follow: false }, }; /** * Rendered per request so the CSP nonce issued by proxy.ts lands on the script * tags — same reason /admin is force-dynamic. Also what lets the redirect once * setup is complete take effect on the next navigation, not a future build. */ export const dynamic = 'force-dynamic'; export default async function InstallPage({ searchParams, }: { searchParams: Promise<{ token?: string }>; }) { if (isInstalled()) { redirect('/'); } const { token } = await searchParams; if (!validateSetupToken(token ?? null)) { // Force evaluation of the token so it is logged. getSetupToken(); return (

Setup Token Required

Check your server logs for the one-time setup token and append ?token= to this URL.

); } const creds = getInstallCredentials(); return ; }