Files
TREK/shared/src/demo/demo-account.ts
T
Maurice cad7d54e83 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.
2026-10-24 23:22:15 +00:00

15 lines
694 B
TypeScript

/**
* The shared account every visitor of a demo instance signs in as.
*
* Both sides ask the same question: the server refuses the writes this
* account may not make, and the client shows the same sections under a demo
* lock. `demo@nomad.app` is the address the account had before the rename, so
* an instance upgraded in place still treats it as the demo account.
*/
export const DEMO_ACCOUNT_EMAILS: readonly string[] = ['demo@trek.app', 'demo@nomad.app'];
/** Whether this address is the demo account's. Instance demo mode is asked apart. */
export function isDemoAccountEmail(email: string | null | undefined): boolean {
return !!email && DEMO_ACCOUNT_EMAILS.includes(email);
}