- return undefined
- let accounts = await root.get('accounts', {})
- return await accounts.get(signed_in_as, {})
+ throw new jst_server.Problem(
+ 'Unauthorized',
+ 'Please sign in first.',
+ 401
+ )
+ let accounts = await root.get('accounts')
+ let account = accounts.get(signed_in_as)
+ if (account === undefined)
+ throw new jst_server.Problem(
+ 'Account expired',
+ 'Database is inconsistent, please sign out and recreate your account.'
+ 507
+ )
+ return account