@riocrypto/common 1.0.408 → 1.0.409
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.
|
@@ -38,7 +38,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
38
38
|
catch (err) { }
|
|
39
39
|
}
|
|
40
40
|
if ((_c = (_b = req.currentAuth) === null || _b === void 0 ? void 0 : _b.missing) === null || _c === void 0 ? void 0 : _c.includes("password")) {
|
|
41
|
-
console.log("hit");
|
|
42
41
|
throw new missing_password_error_1.MissingPasswordError();
|
|
43
42
|
}
|
|
44
43
|
if ((_e = (_d = req.currentAuth) === null || _d === void 0 ? void 0 : _d.missing) === null || _e === void 0 ? void 0 : _e.includes("securityQuestion")) {
|
|
@@ -63,9 +62,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
63
62
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
64
63
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
65
64
|
});
|
|
66
|
-
if (!individualUser) {
|
|
67
|
-
throw new missing_user_error_1.MissingUserError();
|
|
68
|
-
}
|
|
69
65
|
}
|
|
70
66
|
catch (err) {
|
|
71
67
|
individualUser = null;
|
|
@@ -76,9 +72,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
76
72
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
77
73
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
78
74
|
});
|
|
79
|
-
if (!businessUser) {
|
|
80
|
-
throw new missing_user_error_1.MissingUserError();
|
|
81
|
-
}
|
|
82
75
|
}
|
|
83
76
|
catch (err) {
|
|
84
77
|
businessUser = null;
|
|
@@ -135,7 +128,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
135
128
|
if (missingKYC) {
|
|
136
129
|
throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
|
|
137
130
|
}
|
|
138
|
-
if ((
|
|
131
|
+
if ((authorizationTypes.includes(authorization_type_1.AuthorizationType.User) ||
|
|
132
|
+
authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) &&
|
|
133
|
+
((_g = req.cookies) === null || _g === void 0 ? void 0 : _g.jwt)) {
|
|
139
134
|
throw new missing_user_error_1.MissingUserError();
|
|
140
135
|
}
|
|
141
136
|
throw new not_authorized_error_1.NotAuthorizedError();
|