@riocrypto/common 1.0.416 → 1.0.418

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.
@@ -86,12 +86,10 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
86
86
  let businessUser;
87
87
  try {
88
88
  const User = yield (0, user_1.buildUser)(mongoose);
89
- console.log(req.currentAuth);
90
89
  individualUser = yield User.findOne({
91
90
  phoneNumber: req.currentAuth.phoneNumber,
92
91
  attributes: { $ne: user_attribute_1.UserAttribute.deleted },
93
92
  });
94
- console.log(individualUser);
95
93
  if (!individualUser) {
96
94
  throw new Error();
97
95
  }
@@ -130,12 +128,11 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
130
128
  if (missingKYC) {
131
129
  throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
132
130
  }
133
- if ((authorizationTypes.includes(authorization_type_1.AuthorizationType.User) ||
131
+ if (((!req.user && authorizationTypes.includes(authorization_type_1.AuthorizationType.User)) ||
134
132
  authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) &&
135
133
  ((_g = req.cookies) === null || _g === void 0 ? void 0 : _g.jwt)) {
136
134
  throw new missing_user_error_1.MissingUserError();
137
135
  }
138
- console.log("throwing");
139
136
  throw new not_authorized_error_1.NotAuthorizedError();
140
137
  }
141
138
  next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.416",
3
+ "version": "1.0.418",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",