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