let transaction = await env.site.database.Transaction()
try {
- // initialize env.session_key, set cookie in env.response
- let session = await get_session(env, transaction)
+ let root = await transaction.get({})
+ let session = await get_session(env, root)
let captcha = await session.get('captcha')
if (
`Please call the "/api/verification_image.png" endpoint to create a verification image, in same session as the "/api/account/sign_up/create_account.json" call and less than one hour prior.`,
418
)
-
+
let captcha_text = await captcha.get_json('text')
if (verification_code !== captcha_text) {
console.log(`verification code mismatch, \"${verification_code}\" should be \"${captcha_text}\"`)
)
}
- let accounts = await (
- await transaction.get({})
- ).get('accounts', {})
-
+ let accounts = await root.get('accounts', {})
if (accounts.has(details.email))
throw new Problem(
'Account already exists',