-let logjson = (await import('@ndcode/logjson')).default
let XDate = require('xdate')
return async env => {
let captcha = await session.get('captcha')
if (
captcha === undefined ||
- XDate.now() >= await logjson.logjson_to_json(
- await captcha.get('expires')
- )
+ XDate.now() >= await captcha.get_json('expires')
)
throw new Problem(
'No verification image in session',
418
)
- let captcha_text = await logjson.logjson_to_json(
- await captcha.get('text')
- )
+ let captcha_text = await captcha.get_json('text')
if (verification_code !== captcha_text) {
console.log(`verification code mismatch, \"${verification_code}\" should be \"${captcha_text}\"`)
`The email "${details.email}" already has an account registered.`,
420
)
- accounts.set(details.email, transaction.json_to_logjson(details))
+ accounts.set_json(details.email, details)
await transaction.commit()
}
catch (error) {