Use (Transaction|LazyValue).get_json() instead of logjson.logjson_to_json() and ...
[ndcode_site.git] / api / account / sign_up / verify_email.json.jst
index 1fe908c..fe7d701 100644 (file)
@@ -1,5 +1,4 @@
 let crypto = require('crypto')
-let logjson = (await import('@ndcode/logjson')).default
 let XDate = require('xdate')
 
 return async env => {
@@ -39,11 +38,7 @@ 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.`
@@ -53,20 +48,14 @@ return async env => {
         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.`,