@dwtechs/toker-express 0.2.0 → 0.2.1

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.
@@ -38,13 +38,13 @@ const secrets = [TOKEN_SECRET];
38
38
  const accessDuration = isNumber(ACCESS_TOKEN_DURATION, false) ? Number(ACCESS_TOKEN_DURATION) : 600;
39
39
  const refreshDuration = isNumber(REFRESH_TOKEN_DURATION, false) ? Number(REFRESH_TOKEN_DURATION) : 86400;
40
40
  function refresh(req, res, next) {
41
- var _a, _b, _c;
41
+ var _a, _b, _c, _d;
42
42
  let iss = (_a = req.decodedAccessToken) === null || _a === void 0 ? void 0 : _a.iss;
43
- const rbr = req.body.rows;
43
+ const rbr = (_b = req.body) === null || _b === void 0 ? void 0 : _b.rows;
44
44
  let rbrIsArray = false;
45
45
  if (!iss) {
46
- rbrIsArray = isArray(rbr, null, 1);
47
- iss = rbrIsArray ? (_c = (_b = rbr[0]) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString() : null;
46
+ rbrIsArray = isArray(rbr, ">=", 1);
47
+ iss = rbrIsArray ? ((_d = (_c = rbr[0]) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null) : null;
48
48
  }
49
49
  if (!isValidNumber(iss, 1, 999999999, false))
50
50
  return next({ statusCode: 400, message: `${LOGS_PREFIX}Missing iss` });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dwtechs/toker-express",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Open source JWT management library for Express.js to refresh and decode tokens safely.",
5
5
  "keywords": [
6
6
  "JWT",