feat(shared): the demo account's addresses live in one place for both sides

The client is about to lock settings sections for the shared demo account,
and it has to ask the same question the server does. DEMO_ACCOUNT_EMAILS and
isDemoAccountEmail now sit in @trek/shared, and the server's DEMO_EMAILS is
built from them instead of spelling the two addresses a second time.
This commit is contained in:
Maurice
2026-10-24 23:52:37 +02:00
parent 2df677d065
commit cad7d54e83
4 changed files with 39 additions and 1 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import { DEMO_ACCOUNT_EMAILS } from '@trek/shared';
// Central registry of demo-user email addresses.
//
// Historical: the demo account was seeded as "demo@trek.app" (see
@@ -23,7 +25,7 @@ export const DEMO_PASS = 'demo12345';
* Includes the historical `demo@nomad.app` identifier so instances that
* upgraded in place without resetting the DB still hit demo-mode guards.
*/
export const DEMO_EMAILS: ReadonlySet<string> = new Set([DEMO_EMAIL_PRIMARY, 'demo@nomad.app']);
export const DEMO_EMAILS: ReadonlySet<string> = new Set(DEMO_ACCOUNT_EMAILS);
export function isDemoEmail(email: string | null | undefined): boolean {
return !!email && DEMO_EMAILS.has(email);