mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 13:10:29 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user