let crypto = require('crypto')
-let logjson = (await import('@ndcode/logjson')).default
let XDate = require('xdate')
return async env => {
421
)
- if (
- await logjson.logjson_to_json(
- await account.get('email_verified')
- )
- )
+ if (await account.get_json('email_verified'))
throw new Problem(
'Email already verified',
`Your email "${email}" is already verified. You can now sign in.`
let verify_email = await account.get('verify_email')
if (
verify_email === undefined ||
- XDate.now() >= await logjson.logjson_to_json(
- await verify_email.get('expires')
- )
+ XDate.now() >= await verify_email.get_json('expires')
)
throw new Problem(
'Link code missing',
`Email verification link code for account "${email}" does not exist or has expired.`,
423
)
- if (
- link_code !== await logjson.logjson_to_json(
- await verify_email.get('link_code')
- )
- )
+ if (link_code !== await verify_email.get_json('link_code'))
throw new Problem(
'Link code mismatch',
`Provided email verification link code "${link_code}" does not match expected value.`,