@xuda.io/account_module 1.2.1203 → 1.2.1205

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +6 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -576,9 +576,8 @@ export const get_account_info = async function (req) {
576
576
  export const get_active_account_profile_info = async function (uid) {
577
577
  const acc_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
578
578
 
579
- // if (acc_obj.account_info.active_account_profile_id !== acc_obj.account_profile_id) {
580
579
  let active_account_profile_id = acc_obj.account_info.active_account_profile_id;
581
- // }
580
+
582
581
  try {
583
582
  } catch (error) {}
584
583
  const account_profile_obj = await db_module.get_couch_doc_native('xuda_accounts', active_account_profile_id);
@@ -1746,6 +1745,11 @@ export const archive_contact = async function (req) {
1746
1745
  await team_module.validate_share_exist(uid, 'contact', contact_id);
1747
1746
 
1748
1747
  var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
1748
+
1749
+ if (contact_doc.uid !== uid && contact_doc?.account_profile_info?.uid !== uid) {
1750
+ throw new Error('Operation not allowed');
1751
+ }
1752
+
1749
1753
  contact_doc.stat = 5;
1750
1754
  contact_doc.stat_ts = Date.now();
1751
1755
  contact_doc.stat_reason = 'archived by the user';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1203",
3
+ "version": "1.2.1205",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {