1 let jst_server = (await import('@ndcode/jst_server')).default
3 return async (root, session) => {
4 let signed_in_as = await session.get_json('signed_in_as')
5 if (signed_in_as === undefined)
6 throw new jst_server.Problem(
8 'Please sign in first.',
11 let accounts = await root.get('accounts')
12 let account = accounts.get(signed_in_as)
13 if (account === undefined)
14 throw new jst_server.Problem(
16 'Database is inconsistent, please sign out and recreate your account.'