MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / enterDemo

Function enterDemo

apps/client/src/code/auth/demo.ts:9–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { getRegistrationValues } from './register';
8
9export async function enterDemo() {
10 const derivedUserValues: Awaited<ReturnType<typeof deriveUserValues>> = {
11 loginHash: sodium.randombytes_buf(64),
12 masterKey: wrapSymmetricKey(sodium.randombytes_buf(32)),
13 };
14
15 const response = await trpcClient.sessions.startDemo.mutate(
16 await getRegistrationValues({
17 derivedUserValues,
18 userName: 'Demo',
19 }),
20 );
21
22 await login({
23 ...response,
24
25 demo: true,
26 rememberSession: false,
27
28 masterKey: derivedUserValues.masterKey,
29 });
30}

Callers

nothing calls this directly

Calls 3

wrapSymmetricKeyFunction · 0.90
getRegistrationValuesFunction · 0.90
loginFunction · 0.90

Tested by

no test coverage detected