@riocrypto/common 1.0.467 → 1.0.469
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.
|
@@ -50,10 +50,13 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Admin)) {
|
|
53
|
+
console.log("ollie");
|
|
53
54
|
if ((_f = req.cookies) === null || _f === void 0 ? void 0 : _f.adminJwt) {
|
|
54
55
|
try {
|
|
55
56
|
const payload = jsonwebtoken_1.default.verify(req.cookies.adminJwt, process.env.JWT_KEY_ADMIN);
|
|
57
|
+
console.log("ollie2");
|
|
56
58
|
req.currentAdminAuth = payload;
|
|
59
|
+
console.log(req.currentAdminAuth);
|
|
57
60
|
}
|
|
58
61
|
catch (err) { }
|
|
59
62
|
}
|
|
@@ -160,6 +163,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
160
163
|
req.user = user;
|
|
161
164
|
}
|
|
162
165
|
}
|
|
166
|
+
console.log(req);
|
|
163
167
|
if (
|
|
164
168
|
// if no auth
|
|
165
169
|
(!req.currentAdminAuth && !req.currentAuth && !req.user && !req.partner) ||
|
|
@@ -170,7 +174,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
170
174
|
console.log(req.currentAuth);
|
|
171
175
|
if (req.currentAdminAuth &&
|
|
172
176
|
authorizationTypes.includes(authorization_type_1.AuthorizationType.Admin)) {
|
|
177
|
+
console.log("skipping");
|
|
173
178
|
next();
|
|
179
|
+
return;
|
|
174
180
|
}
|
|
175
181
|
if (missingKYC) {
|
|
176
182
|
throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
|