33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { getBranding } from "@/lib/business/branding";
|
|
import { AuthHeader } from "@/features/auth/components/auth-header";
|
|
|
|
/**
|
|
* Every auth page (sign-in, register, forgot-password, verify) shares
|
|
* this shell, so the business logo is shown once here rather than on
|
|
* each page — see the brief's "Authentication Branding" requirement.
|
|
* Unreachable pre-install: src/proxy.ts redirects auth routes to
|
|
* /install until a business exists, so `getBranding()` never falls back
|
|
* to neutral wording here in practice.
|
|
*
|
|
* Forced dynamic: without this, a production build can statically
|
|
* prerender /sign-in and /register with whatever branding (or the
|
|
* neutral fallback) happened to be in the database at *build* time,
|
|
* baked into static HTML served forever after — a real business's name
|
|
* would never actually reach these pages in that deployment. See
|
|
* docs/phase-8-summary.md, "Known limitations" for how this was found
|
|
* (a Docker build with no live database at build time).
|
|
*/
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function AuthLayout({ children }: { children: React.ReactNode }) {
|
|
const branding = await getBranding();
|
|
return (
|
|
<div className="flex min-h-screen flex-col bg-stone p-6">
|
|
<div id="main-content" className="mx-auto flex w-full max-w-md flex-1 flex-col justify-center">
|
|
<AuthHeader logoUrl={branding.logoUrl} />
|
|
{children}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|