@riocrypto/common-server 1.0.762 → 1.0.763

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.
@@ -155,10 +155,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
155
155
  if (!user) {
156
156
  throw new Error();
157
157
  }
158
- if ((user.type === common_1.UserType.Individual &&
159
- (user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.Passed) ||
160
- (user.type === common_1.UserType.Business &&
161
- (user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.businessApproved)) {
158
+ if ((user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.Approved) {
162
159
  missingKYC = true;
163
160
  throw new Error();
164
161
  }
@@ -181,7 +178,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
181
178
  if (!brokerUser) {
182
179
  throw new Error();
183
180
  }
184
- if ((brokerUser === null || brokerUser === void 0 ? void 0 : brokerUser.kycStatus) !== common_1.KYCStatus.businessApproved) {
181
+ if ((brokerUser === null || brokerUser === void 0 ? void 0 : brokerUser.kycStatus) !== common_1.KYCStatus.Approved) {
185
182
  missingKYC = true;
186
183
  throw new Error();
187
184
  }
@@ -13,15 +13,8 @@ exports.validateKYC = void 0;
13
13
  const common_1 = require("@riocrypto/common");
14
14
  const validateKYC = (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
15
15
  const user = req.user;
16
- if ((user === null || user === void 0 ? void 0 : user.type) === common_1.UserType.Individual) {
17
- if (user.kycStatus !== common_1.KYCStatus.Passed) {
18
- throw new common_1.MissingKYCApprovalError();
19
- }
20
- }
21
- if ((user === null || user === void 0 ? void 0 : user.type) === common_1.UserType.Business) {
22
- if (user.kycStatus !== common_1.KYCStatus.businessApproved) {
23
- throw new common_1.MissingKYCApprovalError();
24
- }
16
+ if (!user || user.kycStatus !== common_1.KYCStatus.Approved) {
17
+ throw new common_1.MissingKYCApprovalError();
25
18
  }
26
19
  next();
27
20
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.762",
3
+ "version": "1.0.763",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@everapi/currencyapi-js": "^1.0.6",
26
26
  "@google-cloud/storage": "^6.9.5",
27
- "@riocrypto/common": "^1.0.676",
27
+ "@riocrypto/common": "^1.0.678",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",