@aeriajs/core 0.0.252 → 0.0.254

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.
package/dist/token.js CHANGED
@@ -22,9 +22,13 @@ const signToken = async ({ iat, exp, ...payload }, secret, options) => {
22
22
  if (tokenConfig.name) {
23
23
  payload.aud = tokenConfig.name;
24
24
  }
25
- return jsonwebtoken_1.default.sign(payload, secret || tokenConfig.secret, options || {
26
- expiresIn: tokenConfig.tokenExpiration,
27
- });
25
+ const tokenOptions = options || {};
26
+ if (!options) {
27
+ if (tokenConfig.tokenExpiration) {
28
+ tokenOptions.expiresIn = tokenConfig.tokenExpiration;
29
+ }
30
+ }
31
+ return jsonwebtoken_1.default.sign(payload, secret || tokenConfig.secret, tokenOptions);
28
32
  };
29
33
  exports.signToken = signToken;
30
34
  const decodeToken = async (token, secret) => {
package/dist/token.mjs CHANGED
@@ -17,9 +17,13 @@ export const signToken = async ({ iat, exp, ...payload }, secret, options) => {
17
17
  if (tokenConfig.name) {
18
18
  payload.aud = tokenConfig.name;
19
19
  }
20
- return jwt.sign(payload, secret || tokenConfig.secret, options || {
21
- expiresIn: tokenConfig.tokenExpiration
22
- });
20
+ const tokenOptions = options || {};
21
+ if (!options) {
22
+ if (tokenConfig.tokenExpiration) {
23
+ tokenOptions.expiresIn = tokenConfig.tokenExpiration;
24
+ }
25
+ }
26
+ return jwt.sign(payload, secret || tokenConfig.secret, tokenOptions);
23
27
  };
24
28
  export const decodeToken = async (token, secret) => {
25
29
  const tokenConfig = await getTokenConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/core",
3
- "version": "0.0.252",
3
+ "version": "0.0.254",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "aeriaMain": "tests/fixtures/aeriaMain.js",
@@ -42,13 +42,13 @@
42
42
  "mongodb-memory-server": "^9.2.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@aeriajs/builtins": "^0.0.252",
46
- "@aeriajs/common": "^0.0.141",
47
- "@aeriajs/entrypoint": "^0.0.145",
48
- "@aeriajs/http": "^0.0.170",
49
- "@aeriajs/security": "^0.0.252",
50
- "@aeriajs/types": "^0.0.123",
51
- "@aeriajs/validation": "^0.0.157"
45
+ "@aeriajs/builtins": "^0.0.254",
46
+ "@aeriajs/common": "^0.0.142",
47
+ "@aeriajs/entrypoint": "^0.0.146",
48
+ "@aeriajs/http": "^0.0.171",
49
+ "@aeriajs/security": "^0.0.254",
50
+ "@aeriajs/types": "^0.0.124",
51
+ "@aeriajs/validation": "^0.0.158"
52
52
  },
53
53
  "dependencies": {
54
54
  "mongodb": "^6.5.0",