@riocrypto/common 1.0.411 → 1.0.413
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.
- package/build/middlewares/authorize.js +0 -3
- package/build/middlewares/get-order.js +1 -1
- package/build/models/bank-payout.js +1 -1
- package/build/models/business-user.js +1 -1
- package/build/models/order.js +1 -1
- package/build/models/partner.js +1 -1
- package/build/models/user.js +1 -1
- package/package.json +1 -1
|
@@ -128,12 +128,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
128
128
|
if (missingKYC) {
|
|
129
129
|
throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
|
|
130
130
|
}
|
|
131
|
-
console.log(authorizationTypes);
|
|
132
|
-
console.log(req.cookies);
|
|
133
131
|
if ((authorizationTypes.includes(authorization_type_1.AuthorizationType.User) ||
|
|
134
132
|
authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) &&
|
|
135
133
|
((_g = req.cookies) === null || _g === void 0 ? void 0 : _g.jwt)) {
|
|
136
|
-
console.log("hit");
|
|
137
134
|
throw new missing_user_error_1.MissingUserError();
|
|
138
135
|
}
|
|
139
136
|
throw new not_authorized_error_1.NotAuthorizedError();
|
|
@@ -39,7 +39,7 @@ const getOrder = (req, res, next, mongoose) => __awaiter(void 0, void 0, void 0,
|
|
|
39
39
|
catch (error) {
|
|
40
40
|
throw new not_found_error_1.NotFoundError();
|
|
41
41
|
}
|
|
42
|
-
if (req.order.userId !== ((_a = req.user) === null || _a === void 0 ? void 0 : _a.id) && !req.currentAdminAuth) {
|
|
42
|
+
if (req.order.userId !== ((_a = req.user) === null || _a === void 0 ? void 0 : _a.toJSON().id) && !req.currentAdminAuth) {
|
|
43
43
|
throw new not_authorized_error_1.NotAuthorizedError();
|
|
44
44
|
}
|
|
45
45
|
next();
|
package/build/models/order.js
CHANGED
package/build/models/partner.js
CHANGED
package/build/models/user.js
CHANGED