refactor: remove hotel-name fallback, fail fast when unconfigured
Drop the hardcoded FALLBACK_HOTEL_NAME ("Atom") preset and the brand.ts
module. HOTEL_NAME is now a required env var: if it (and the CMS hotel_name
setting) is missing the site fails validation at startup/build with a clear
message instead of silently rendering a placeholder hotel name.
resolveHotelName() resolves CMS hotel_name -> required HOTEL_NAME only.
Callers that used the preset (api/home route catch branch, CMS settings form
default, mobile-nav/logo-generator prop defaults) now use the configured name
or an empty default; the real name is already passed in by server parents.
This commit is contained in:
1 parent
555c783d55
commit
164a4f4ef6
8 files changed
+19
-30
No files matched your search
+6
-2
@@ -1,5 +1,4 @@
|
||||
import { z } from "zod";
|
||||
import { FALLBACK_HOTEL_NAME } from "@/lib/brand";
|
||||
|
||||
// Minimal validated env for the foundation. When the Next.js app is added this
|
||||
// will move to @t3-oss/env-nextjs (the habbo-next pattern), but the data layer
|
||||
@@ -25,7 +24,12 @@ const schema = z
|
||||
.int()
|
||||
.positive()
|
||||
.default(10_000),
|
||||
HOTEL_NAME: z.string().default(FALLBACK_HOTEL_NAME),
|
||||
HOTEL_NAME: z
|
||||
.string()
|
||||
.min(
|
||||
1,
|
||||
"HOTEL_NAME is not set — the site has not been configured/built yet.",
|
||||
),
|
||||
APP_URL: z.string().url().default("http://localhost:3000"),
|
||||
NEXT_PUBLIC_APP_URL: z.string().url().default("http://localhost:3000"),
|
||||
// Public imager URL — overrides the default /imaging relative path.
|
||||
|
||||
Reference in new issue
Block a user