vona-module-a-jwt 5.0.21 → 5.0.23

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/index.js CHANGED
@@ -26,8 +26,8 @@ let ServiceJwtClient = (_dec$4 = Service(), _dec2$4 = BeanInfo({
26
26
  const configJwt = this.scope.config;
27
27
  const configClient = configJwt.clients[clientName];
28
28
  if (!configClient) throw new Error(`jwt client not found: ${clientName}`);
29
- const secret = configJwt.default.secret ?? this.app.config.server.keys[0];
30
- this._clientOptions = deepExtend({}, configJwt.default, {
29
+ const secret = configJwt.base.secret ?? this.app.config.server.keys[0];
30
+ this._clientOptions = deepExtend({}, configJwt.base, {
31
31
  secret
32
32
  }, configClient);
33
33
  this._clientName = clientName;
@@ -104,7 +104,7 @@ let BeanJwt = (_dec$3 = Bean(), _dec2$3 = BeanInfo({
104
104
  const refreshToken = await this.get('refresh').sign(payloadData, options);
105
105
  // expiresIn
106
106
  let expiresIn = this.scope.config.clients.access.signOptions.expiresIn;
107
- if (typeof expiresIn === 'string') expiresIn = ms(expiresIn);
107
+ if (typeof expiresIn === 'string') expiresIn = Math.floor(ms(expiresIn) / 1000);
108
108
  // ok
109
109
  return {
110
110
  accessToken,
@@ -231,7 +231,7 @@ function config(app) {
231
231
  expiresIn: 10 * 60
232
232
  }
233
233
  },
234
- default: {
234
+ base: {
235
235
  secret: undefined,
236
236
  signOptions: {
237
237
  issuer: app.meta.env.APP_NAME
@@ -44,7 +44,7 @@ export interface ConfigJwt {
44
44
  expiresIn: number;
45
45
  };
46
46
  };
47
- default: IJwtClientOptions;
47
+ base: IJwtClientOptions;
48
48
  clients: Record<keyof IJwtClientRecord, IJwtClientOptions>;
49
49
  }
50
50
  export interface IPayloadData {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-jwt",
3
3
  "type": "module",
4
- "version": "5.0.21",
4
+ "version": "5.0.23",
5
5
  "title": "a-jwt",
6
6
  "vonaModule": {
7
7
  "dependencies": {}
@@ -22,8 +22,8 @@
22
22
  "./package.json": "./package.json"
23
23
  },
24
24
  "files": [
25
- "dist",
26
- "static"
25
+ "assets",
26
+ "dist"
27
27
  ],
28
28
  "dependencies": {
29
29
  "@types/jsonwebtoken": "9.0.8",