@citec-spbu/jwt 1.0.0 → 1.0.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.
@@ -80,10 +80,13 @@ let ConsumerModule = (() => {
80
80
  imports: [
81
81
  ...(options.imports || []),
82
82
  jwt_1.JwtModule.registerAsync({
83
- useFactory: async (options) => ({
84
- publicKey: options.publicKey,
85
- signOptions: JWT_VERIFY_OPTIONS
86
- }),
83
+ useFactory: async (...args) => {
84
+ const consumerOptions = await options.useFactory(...args);
85
+ return {
86
+ publicKey: consumerOptions.publicKey,
87
+ signOptions: JWT_VERIFY_OPTIONS
88
+ };
89
+ },
87
90
  inject: [constants_1.CONSUMER_OPTIONS]
88
91
  })
89
92
  ],
@@ -81,10 +81,13 @@ let IssuerModule = (() => {
81
81
  imports: [
82
82
  ...(options.imports || []),
83
83
  jwt_1.JwtModule.registerAsync({
84
- useFactory: async (options) => ({
85
- privateKey: options.privateKey,
86
- signOptions: JWT_SIGN_OPTIONS
87
- }),
84
+ useFactory: async (...args) => {
85
+ const issuerOptions = await options.useFactory(...args);
86
+ return {
87
+ privateKey: issuerOptions.privateKey,
88
+ signOptions: JWT_SIGN_OPTIONS
89
+ };
90
+ },
88
91
  inject: [constants_1.ISSUER_OPTIONS]
89
92
  })
90
93
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citec-spbu/jwt",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lightweight auth lib",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",