@riocrypto/common 1.0.417 → 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
  }
@@ -121,7 +119,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
121
119
  businessUser = null;
122
120
  }
123
121
  const user = individualUser || businessUser;
124
- console.log("final user is ", user);
125
122
  if (user) {
126
123
  req.user = user;
127
124
  }
@@ -131,13 +128,11 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
131
128
  if (missingKYC) {
132
129
  throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
133
130
  }
134
- if ((authorizationTypes.includes(authorization_type_1.AuthorizationType.User) ||
131
+ if (((!req.user && authorizationTypes.includes(authorization_type_1.AuthorizationType.User)) ||
135
132
  authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) &&
136
133
  ((_g = req.cookies) === null || _g === void 0 ? void 0 : _g.jwt)) {
137
- console.log("chimichanga");
138
134
  throw new missing_user_error_1.MissingUserError();
139
135
  }
140
- console.log("throwing");
141
136
  throw new not_authorized_error_1.NotAuthorizedError();
142
137
  }
143
138
  next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.417",
3
+ "version": "1.0.418",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",