@riocrypto/common 1.0.471 → 1.0.473
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.
|
@@ -59,12 +59,14 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Partner)) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
if (req.currentAuth.id) {
|
|
63
|
+
const Partner = yield (0, partner_1.buildPartner)(mongoose);
|
|
64
|
+
const partner = yield Partner.findOne({
|
|
65
|
+
authId: req.currentAuth.id,
|
|
66
|
+
});
|
|
67
|
+
if (partner) {
|
|
68
|
+
req.partner = partner;
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC)) {
|
|
@@ -160,6 +162,10 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
160
162
|
req.user = user;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
165
|
+
console.log("req.currentAuth", req.currentAuth);
|
|
166
|
+
console.log("req.currentAdminAuth", req.currentAdminAuth);
|
|
167
|
+
console.log("req.user", req.user);
|
|
168
|
+
console.log("req.partner", req.partner);
|
|
163
169
|
if (
|
|
164
170
|
// if no auth
|
|
165
171
|
(!req.currentAdminAuth && !req.currentAuth && !req.user && !req.partner) ||
|