Make get_session() readonly and throw an exception if session cannot be found rather...
[ndcode_site.git] / api / account / sign_in.json.jst
index e35392f..87961f5 100644 (file)
@@ -21,7 +21,8 @@ return async env => {
 
       let transaction = await env.site.database.Transaction()
       try {
-        let root = await transaction.get({})
+        let root = await transaction.get()
+        let session = await get_session(env, root)
 
         let accounts = await root.get('accounts', {})
         let account = await accounts.get(email)
@@ -42,7 +43,6 @@ return async env => {
             425
           )
 
-        let session = await get_session(env, root)
         session.set_json('signed_in_as', email)
         await transaction.commit()
       }