return async env => {
let post_request = await _require('/_lib/post_request.jst')
- let get_session = await _require('/_lib/get_session.jst')
let Problem = await _require('/_lib/Problem.jst')
await post_request(
let transaction = await env.site.database.Transaction()
try {
- // initialize env.session_key, set cookie in env.response
- await get_session(env, transaction)
-
- let account = await (
- await (
- await transaction.get({})
- ).get('accounts', {})
- ).get(email)
+ let root = await transaction.get({})
+ let accounts = await root.get('accounts', {})
+ let account = await accounts.get(email)
if (account === undefined)
throw new Problem(
'Account does not exist',
await account.delete('verify_email')
await account.set('email_verified', true)
-
await transaction.commit()
}
catch (error) {