@riocrypto/common 1.0.466 → 1.0.468

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
  }
@@ -166,9 +169,13 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
166
169
  (!req.currentAuth &&
167
170
  !authorizationTypes.includes(authorization_type_1.AuthorizationType.Auth) &&
168
171
  !req.user)) {
172
+ console.log("no auth");
173
+ console.log(req.currentAuth);
169
174
  if (req.currentAdminAuth &&
170
175
  authorizationTypes.includes(authorization_type_1.AuthorizationType.Admin)) {
176
+ console.log("skipping");
171
177
  next();
178
+ return;
172
179
  }
173
180
  if (missingKYC) {
174
181
  throw new missing_kyc_approval_error_1.MissingKYCApprovalError();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.466",
3
+ "version": "1.0.468",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",