Make get_session() readonly and throw an exception if session cannot be found rather...
[ndcode_site.git] / api / account / change_details / set.json.jst
index e3de45c..bc276f6 100644 (file)
@@ -25,17 +25,10 @@ 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 account = await get_account(root, session)
-        if (account === undefined)
-          throw new jst_server.Problem(
-            'Unauthorized',
-            'Please sign in first.',
-            401
-          )
-
         account.set_json('given_names', details.given_names)
         account.set_json('family_name', details.family_name)
         account.set_json('contact_me', details.contact_me)