@riocrypto/common 1.0.402 → 1.0.403
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.
|
@@ -96,6 +96,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
96
96
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
97
97
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
98
98
|
});
|
|
99
|
+
if (!individualUser) {
|
|
100
|
+
throw new Error();
|
|
101
|
+
}
|
|
99
102
|
if ((individualUser === null || individualUser === void 0 ? void 0 : individualUser.kycStatus) !== kyc_status_1.KYCStatus.Passed) {
|
|
100
103
|
missingKYC = true;
|
|
101
104
|
throw new Error();
|
|
@@ -110,6 +113,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
110
113
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
111
114
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
112
115
|
});
|
|
116
|
+
if (!businessUser) {
|
|
117
|
+
throw new Error();
|
|
118
|
+
}
|
|
113
119
|
if ((businessUser === null || businessUser === void 0 ? void 0 : businessUser.kycStatus) !== kyc_status_1.KYCStatus.businessApproved) {
|
|
114
120
|
missingKYC = true;
|
|
115
121
|
throw new Error();
|