@riocrypto/common 1.0.402 → 1.0.404
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.
|
@@ -37,6 +37,8 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
37
37
|
}
|
|
38
38
|
catch (err) { }
|
|
39
39
|
}
|
|
40
|
+
console.log("req.currentAuth");
|
|
41
|
+
console.log(req.currentAuth);
|
|
40
42
|
if ((_c = (_b = req.currentAuth) === null || _b === void 0 ? void 0 : _b.missing) === null || _c === void 0 ? void 0 : _c.includes("password")) {
|
|
41
43
|
throw new missing_password_error_1.MissingPasswordError();
|
|
42
44
|
}
|
|
@@ -96,6 +98,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
96
98
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
97
99
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
98
100
|
});
|
|
101
|
+
if (!individualUser) {
|
|
102
|
+
throw new Error();
|
|
103
|
+
}
|
|
99
104
|
if ((individualUser === null || individualUser === void 0 ? void 0 : individualUser.kycStatus) !== kyc_status_1.KYCStatus.Passed) {
|
|
100
105
|
missingKYC = true;
|
|
101
106
|
throw new Error();
|
|
@@ -110,6 +115,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
110
115
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
111
116
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
112
117
|
});
|
|
118
|
+
if (!businessUser) {
|
|
119
|
+
throw new Error();
|
|
120
|
+
}
|
|
113
121
|
if ((businessUser === null || businessUser === void 0 ? void 0 : businessUser.kycStatus) !== kyc_status_1.KYCStatus.businessApproved) {
|
|
114
122
|
missingKYC = true;
|
|
115
123
|
throw new Error();
|