@riocrypto/common 1.0.473 → 1.0.475

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.
@@ -58,15 +58,14 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
58
58
  catch (err) { }
59
59
  }
60
60
  }
61
- if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Partner)) {
62
- if (req.currentAuth.id) {
63
- const Partner = yield (0, partner_1.buildPartner)(mongoose);
64
- const partner = yield Partner.findOne({
65
- authId: req.currentAuth.id,
66
- });
67
- if (partner) {
68
- req.partner = partner;
69
- }
61
+ if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Partner) &&
62
+ req.currentAuth) {
63
+ const Partner = yield (0, partner_1.buildPartner)(mongoose);
64
+ const partner = yield Partner.findOne({
65
+ authId: req.currentAuth.id,
66
+ });
67
+ if (partner) {
68
+ req.partner = partner;
70
69
  }
71
70
  }
72
71
  if (authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) {
@@ -162,10 +161,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
162
161
  req.user = user;
163
162
  }
164
163
  }
165
- console.log("req.currentAuth", req.currentAuth);
166
- console.log("req.currentAdminAuth", req.currentAdminAuth);
167
- console.log("req.user", req.user);
168
- console.log("req.partner", req.partner);
169
164
  if (
170
165
  // if no auth
171
166
  (!req.currentAdminAuth && !req.currentAuth && !req.user && !req.partner) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.473",
3
+ "version": "1.0.475",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",