ecrs-auth-core 1.0.20 → 1.0.21

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.
Files changed (2) hide show
  1. package/dist/auth.module.js +12 -14
  2. package/package.json +1 -1
@@ -22,23 +22,21 @@ const permission_guard_1 = require("./guards/permission.guard");
22
22
  exports.AUTH_CORE_OPTIONS = "AUTH_CORE_OPTIONS";
23
23
  let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
24
24
  static register(options) {
25
+ const optionsProvider = {
26
+ provide: exports.AUTH_CORE_OPTIONS,
27
+ useValue: options,
28
+ };
25
29
  return {
26
30
  module: AuthCoreModule_1,
27
31
  imports: [
28
- jwt_1.JwtModule.registerAsync({
29
- useFactory: (options) => ({
30
- secret: options.jwtSecret,
31
- signOptions: { expiresIn: options.jwtExpiresIn },
32
- }),
33
- inject: [exports.AUTH_CORE_OPTIONS],
32
+ jwt_1.JwtModule.register({
33
+ secret: options.jwtSecret,
34
+ signOptions: { expiresIn: options.jwtExpiresIn },
34
35
  }),
35
36
  ],
36
37
  controllers: [auth_controller_1.AuthController],
37
38
  providers: [
38
- {
39
- provide: exports.AUTH_CORE_OPTIONS,
40
- useValue: options,
41
- },
39
+ optionsProvider,
42
40
  auth_service_1.AuthService,
43
41
  jwt_strategy_1.JwtStrategy,
44
42
  jwt_guard_1.JwtAuthGuard,
@@ -70,16 +68,16 @@ let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
70
68
  module: AuthCoreModule_1,
71
69
  imports: [
72
70
  jwt_1.JwtModule.registerAsync({
73
- useFactory: (options) => ({
74
- secret: options.jwtSecret,
75
- signOptions: { expiresIn: options.jwtExpiresIn },
71
+ useFactory: (authOptions) => ({
72
+ secret: authOptions.jwtSecret,
73
+ signOptions: { expiresIn: authOptions.jwtExpiresIn },
76
74
  }),
77
75
  inject: [exports.AUTH_CORE_OPTIONS],
78
76
  }),
79
77
  ],
80
78
  controllers: [auth_controller_1.AuthController],
81
79
  providers: [
82
- asyncProvider,
80
+ asyncProvider, // ✅ Register the option provider before JwtModule uses it
83
81
  auth_service_1.AuthService,
84
82
  jwt_strategy_1.JwtStrategy,
85
83
  jwt_guard_1.JwtAuthGuard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecrs-auth-core",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Centralized authentication and authorization module for ECRS apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",