mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 22:27:32 +00:00
cad7d54e83
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.
15 lines
694 B
TypeScript
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);
|
|
}
|