@riocrypto/common-server 1.0.1578 → 1.0.1579

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.
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireAdminAuthIfDefined = void 0;
4
4
  const requireAdminAuthIfDefined = (value, { req, path }) => {
5
+ console.log("path", path);
6
+ console.log("value", value);
7
+ console.log("current value", getValueByPath(req.userToUpdate, path));
5
8
  if (value !== undefined &&
6
9
  value !== "" &&
7
10
  !req.adminAuth &&
@@ -19,6 +22,10 @@ function getValueByPath(obj, path) {
19
22
  const keys = path.split(".");
20
23
  let current = obj;
21
24
  for (let key of keys) {
25
+ // @ts-ignore
26
+ if (!current[key]) {
27
+ return undefined;
28
+ }
22
29
  // @ts-ignore
23
30
  current = current[key];
24
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1578",
3
+ "version": "1.0.1579",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",