@kronos-integration/service-authenticator 4.1.2 → 4.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service-authenticator",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -30,8 +30,8 @@
30
30
  "lint:docs": "documentation lint ./src**/*.mjs"
31
31
  },
32
32
  "dependencies": {
33
- "@kronos-integration/endpoint": "^11.0.5",
34
- "@kronos-integration/service": "^15.1.2",
33
+ "@kronos-integration/endpoint": "^11.0.6",
34
+ "@kronos-integration/service": "^15.1.4",
35
35
  "jsonwebtoken": "^9.0.3"
36
36
  },
37
37
  "devDependencies": {
@@ -5,7 +5,8 @@ import {
5
5
  default_attribute,
6
6
  public_key_attribute,
7
7
  private_key_attribute,
8
- object_attribute
8
+ object_attribute,
9
+ duration_ms_attribute
9
10
  } from "pacc";
10
11
  import { Service } from "@kronos-integration/service";
11
12
 
@@ -60,15 +61,17 @@ export class ServiceAuthenticator extends Service {
60
61
  }
61
62
  },
62
63
  access_token: {
64
+ ...object_attribute,
63
65
  attributes: {
64
66
  algorithm,
65
- expiresIn: { default: "1h", type: "duration" }
67
+ expiresIn: { ...duration_ms_attribute, default: "1h" }
66
68
  }
67
69
  },
68
70
  refresh_token: {
71
+ ...object_attribute,
69
72
  attributes: {
70
73
  algorithm,
71
- expiresIn: { default: "90d", type: "duration" }
74
+ expiresIn: { ...duration_ms_attribute, default: "90d" }
72
75
  }
73
76
  }
74
77
  }
@@ -182,7 +185,7 @@ export class ServiceAuthenticator extends Service {
182
185
  };
183
186
  return {
184
187
  token_type: "Bearer",
185
- expires_in: j.access_token.expiresIn,
188
+ expires_in: j.access_token.expiresIn / 1000,
186
189
  access_token: jwt.sign(claims, j.private, j.access_token),
187
190
  refresh_token: jwt.sign(refreshClaims, j.private, j.refresh_token)
188
191
  };