ecrs-auth-core 1.0.29 → 1.0.31

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 +16 -73
  2. package/package.json +1 -1
@@ -20,87 +20,31 @@ const feature_guard_1 = require("./guards/feature.guard");
20
20
  const route_guard_1 = require("./guards/route.guard");
21
21
  const permission_guard_1 = require("./guards/permission.guard");
22
22
  exports.AUTH_CORE_OPTIONS = 'AUTH_CORE_OPTIONS';
23
- // @Global()
24
- // @Module({})
25
- // export class AuthCoreModule {
26
- // static registerAsync(options: {
27
- // inject: any[];
28
- // useFactory: (...args: any[]) => Promise<AuthCoreOptions>;
29
- // }): DynamicModule {
30
- // const asyncProvider = {
31
- // provide: AUTH_CORE_OPTIONS,
32
- // inject: options.inject,
33
- // useFactory: options.useFactory,
34
- // };
35
- // return {
36
- // module: AuthCoreModule,
37
- // imports: [JwtModule.register({})],
38
- // providers: [
39
- // asyncProvider,
40
- // {
41
- // provide: 'ASYNC_JWT_OPTIONS',
42
- // useFactory: async (options: AuthCoreOptions) => ({
43
- // secret: options.jwtSecret,
44
- // signOptions: { expiresIn: options.jwtExpiresIn },
45
- // }),
46
- // inject: [AUTH_CORE_OPTIONS],
47
- // },
48
- // {
49
- // provide: JwtModule,
50
- // useFactory: async (jwtOptions: any) => JwtModule.register(jwtOptions),
51
- // inject: ['ASYNC_JWT_OPTIONS'],
52
- // },
53
- // {
54
- // provide: 'MODULE_CONFIG',
55
- // useFactory: (options: AuthCoreOptions) => options.moduleConfig || {},
56
- // inject: [AUTH_CORE_OPTIONS],
57
- // },
58
- // AuthService,
59
- // JwtStrategy,
60
- // JwtAuthGuard,
61
- // ModuleGuard,
62
- // RolesGuard,
63
- // FeatureGuard,
64
- // RouteGuard,
65
- // PermissionGuard,
66
- // ],
67
- // controllers: [AuthController],
68
- // exports: [
69
- // AuthService,
70
- // JwtStrategy,
71
- // JwtAuthGuard,
72
- // ModuleGuard,
73
- // RolesGuard,
74
- // FeatureGuard,
75
- // RouteGuard,
76
- // PermissionGuard,
77
- // ],
78
- // };
79
- // }
80
- // }
81
23
  let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
82
24
  static registerAsync(options) {
83
- const authCoreOptionsProvider = {
25
+ const asyncProvider = {
84
26
  provide: exports.AUTH_CORE_OPTIONS,
85
27
  inject: options.inject,
86
28
  useFactory: options.useFactory,
87
29
  };
88
- const asyncJwtModule = jwt_1.JwtModule.registerAsync({
89
- inject: [exports.AUTH_CORE_OPTIONS],
90
- useFactory: async (options) => {
91
- console.log('✅ JWT_SECRET:', options.jwtSecret);
92
- console.log('✅ JWT_EXPIRES_IN:', options.jwtExpiresIn);
93
- return {
94
- secret: options.jwtSecret,
95
- signOptions: { expiresIn: options.jwtExpiresIn },
96
- };
97
- },
98
- });
99
30
  return {
100
31
  module: AuthCoreModule_1,
101
- imports: [asyncJwtModule],
32
+ imports: [jwt_1.JwtModule.register({})],
102
33
  providers: [
103
- authCoreOptionsProvider,
34
+ asyncProvider,
35
+ {
36
+ provide: 'ASYNC_JWT_OPTIONS',
37
+ useFactory: async (options) => ({
38
+ secret: options.jwtSecret,
39
+ signOptions: { expiresIn: options.jwtExpiresIn },
40
+ }),
41
+ inject: [exports.AUTH_CORE_OPTIONS],
42
+ },
43
+ {
44
+ provide: jwt_1.JwtModule,
45
+ useFactory: async (jwtOptions) => jwt_1.JwtModule.register(jwtOptions),
46
+ inject: ['ASYNC_JWT_OPTIONS'],
47
+ },
104
48
  {
105
49
  provide: 'MODULE_CONFIG',
106
50
  useFactory: (options) => options.moduleConfig || {},
@@ -117,7 +61,6 @@ let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
117
61
  ],
118
62
  controllers: [auth_controller_1.AuthController],
119
63
  exports: [
120
- jwt_1.JwtModule,
121
64
  auth_service_1.AuthService,
122
65
  jwt_strategy_1.JwtStrategy,
123
66
  jwt_guard_1.JwtAuthGuard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecrs-auth-core",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Centralized authentication and authorization module for ECRS apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",