Use (Transaction|LazyValue).get_json() instead of logjson.logjson_to_json() and ...
[ndcode_site.git] / api / account / sign_in.json.jst
index b963f97..ecd0f4e 100644 (file)
@@ -1,5 +1,3 @@
-let logjson = (await import('@ndcode/logjson')).default
-
 return async env => {
   let globals = await env.site.get_json('/_config/globals.json')
   let nodemailer_noreply = await env.site.get_nodemailer(
@@ -36,9 +34,7 @@ return async env => {
         ).get(email)
         if (
           account === undefined ||
-            password !== await logjson.logjson_to_json(
-              await account.get('password')
-            )
+            password !== await account.get_json('password')
         )
           throw new Problem(
             'Unauthorized',
@@ -46,19 +42,14 @@ return async env => {
             401
           )
 
-        if (
-          !await logjson.logjson_to_json(
-            await account.get('email_verified')
-          )
-        )
+        if (!await account.get_json('email_verified'))
           throw new Problem(
             'Email not yet verified',
             'Please verify your email address via email link before trying to sign in.',
             425
           )
 
-        session.set('signed_in_as', transaction.json_to_logjson(email))
-
+        session.set_json('signed_in_as', email)
         await transaction.commit()
       }
       catch (error) {