@riocrypto/common 1.0.415 → 1.0.416
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.
|
@@ -86,10 +86,12 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
86
86
|
let businessUser;
|
|
87
87
|
try {
|
|
88
88
|
const User = yield (0, user_1.buildUser)(mongoose);
|
|
89
|
+
console.log(req.currentAuth);
|
|
89
90
|
individualUser = yield User.findOne({
|
|
90
91
|
phoneNumber: req.currentAuth.phoneNumber,
|
|
91
92
|
attributes: { $ne: user_attribute_1.UserAttribute.deleted },
|
|
92
93
|
});
|
|
94
|
+
console.log(individualUser);
|
|
93
95
|
if (!individualUser) {
|
|
94
96
|
throw new Error();
|
|
95
97
|
}
|
|
@@ -40,7 +40,6 @@ const getOrder = (req, res, next, mongoose) => __awaiter(void 0, void 0, void 0,
|
|
|
40
40
|
throw new not_found_error_1.NotFoundError();
|
|
41
41
|
}
|
|
42
42
|
if (req.order.userId !== ((_a = req.user) === null || _a === void 0 ? void 0 : _a.toJSON().id) && !req.currentAdminAuth) {
|
|
43
|
-
console.log("aqui men");
|
|
44
43
|
throw new not_authorized_error_1.NotAuthorizedError();
|
|
45
44
|
}
|
|
46
45
|
next();
|