@flusys/nestjs-auth 1.1.0-beta → 2.0.0

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 (86) hide show
  1. package/README.md +590 -473
  2. package/cjs/config/auth.constants.js +8 -0
  3. package/cjs/controllers/authentication.controller.js +218 -39
  4. package/cjs/controllers/branch.controller.js +44 -1
  5. package/cjs/controllers/company-selection.controller.js +27 -20
  6. package/cjs/controllers/company.controller.js +44 -1
  7. package/cjs/controllers/user-permission.controller.js +82 -154
  8. package/cjs/controllers/user.controller.js +68 -15
  9. package/cjs/docs/auth-swagger.config.js +14 -7
  10. package/cjs/dtos/authentication.dto.js +16 -43
  11. package/cjs/dtos/index.js +0 -1
  12. package/cjs/dtos/user-permission.dto.js +28 -0
  13. package/cjs/dtos/user.dto.js +19 -4
  14. package/cjs/entities/user-company-permission.entity.js +0 -6
  15. package/cjs/interceptors/clear-token.interceptor.js +10 -23
  16. package/cjs/interceptors/set-token.interceptor.js +15 -55
  17. package/cjs/interfaces/auth-email-provider.interface.js +1 -1
  18. package/cjs/modules/auth.module.js +63 -147
  19. package/cjs/services/auth-config.service.js +22 -28
  20. package/cjs/services/auth-datasource.provider.js +9 -21
  21. package/cjs/services/auth-email.service.js +89 -85
  22. package/cjs/services/authentication.service.js +225 -396
  23. package/cjs/services/branch.service.js +9 -4
  24. package/cjs/services/company-selection-session.service.js +1 -1
  25. package/cjs/services/user-permission.service.js +43 -73
  26. package/cjs/services/user.service.js +78 -64
  27. package/cjs/strategies/jwt.strategy.js +44 -44
  28. package/cjs/validators/password.validator.js +45 -0
  29. package/config/auth.constants.d.ts +2 -0
  30. package/controllers/authentication.controller.d.ts +5 -3
  31. package/controllers/company-selection.controller.d.ts +6 -2
  32. package/controllers/user-permission.controller.d.ts +5 -4
  33. package/controllers/user.controller.d.ts +6 -0
  34. package/dtos/authentication.dto.d.ts +0 -4
  35. package/dtos/company-branch.dto.d.ts +0 -1
  36. package/dtos/company.dto.d.ts +0 -1
  37. package/dtos/index.d.ts +0 -1
  38. package/dtos/user-permission.dto.d.ts +4 -0
  39. package/dtos/user.dto.d.ts +1 -3
  40. package/entities/index.d.ts +3 -3
  41. package/entities/user-company-permission.entity.d.ts +0 -2
  42. package/fesm/config/auth.constants.js +6 -13
  43. package/fesm/controllers/authentication.controller.js +221 -42
  44. package/fesm/controllers/branch.controller.js +45 -2
  45. package/fesm/controllers/company-selection.controller.js +28 -21
  46. package/fesm/controllers/company.controller.js +45 -2
  47. package/fesm/controllers/user-permission.controller.js +84 -156
  48. package/fesm/controllers/user.controller.js +71 -18
  49. package/fesm/docs/auth-swagger.config.js +14 -7
  50. package/fesm/dtos/authentication.dto.js +17 -44
  51. package/fesm/dtos/index.js +0 -1
  52. package/fesm/dtos/user-permission.dto.js +28 -0
  53. package/fesm/dtos/user.dto.js +20 -5
  54. package/fesm/entities/user-company-permission.entity.js +0 -6
  55. package/fesm/interceptors/clear-token.interceptor.js +9 -22
  56. package/fesm/interceptors/set-token.interceptor.js +14 -54
  57. package/fesm/interfaces/auth-email-provider.interface.js +1 -1
  58. package/fesm/modules/auth.module.js +64 -148
  59. package/fesm/services/auth-config.service.js +23 -29
  60. package/fesm/services/auth-datasource.provider.js +10 -22
  61. package/fesm/services/auth-email.service.js +90 -86
  62. package/fesm/services/authentication.service.js +225 -396
  63. package/fesm/services/branch.service.js +9 -4
  64. package/fesm/services/company-selection-session.service.js +1 -1
  65. package/fesm/services/user-permission.service.js +44 -74
  66. package/fesm/services/user.service.js +79 -65
  67. package/fesm/strategies/jwt.strategy.js +44 -44
  68. package/fesm/validators/password.validator.js +48 -0
  69. package/interceptors/clear-token.interceptor.d.ts +0 -1
  70. package/interceptors/set-token.interceptor.d.ts +1 -1
  71. package/interfaces/authentication.interface.d.ts +0 -4
  72. package/interfaces/user-enricher.interface.d.ts +1 -4
  73. package/modules/auth.module.d.ts +6 -3
  74. package/package.json +4 -4
  75. package/services/auth-config.service.d.ts +6 -8
  76. package/services/auth-datasource.provider.d.ts +2 -4
  77. package/services/auth-email.service.d.ts +8 -4
  78. package/services/authentication.service.d.ts +15 -16
  79. package/services/company-selection-session.service.d.ts +1 -1
  80. package/services/user-permission.service.d.ts +6 -9
  81. package/services/user.service.d.ts +3 -0
  82. package/strategies/jwt.strategy.d.ts +4 -1
  83. package/validators/password.validator.d.ts +10 -0
  84. package/cjs/dtos/user-company-permission.dto.js +0 -110
  85. package/dtos/user-company-permission.dto.d.ts +0 -10
  86. package/fesm/dtos/user-company-permission.dto.js +0 -98
@@ -5,98 +5,57 @@ function _ts_decorate(decorators, target, key, desc) {
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  }
7
7
  import { CacheModule, UtilsModule } from '@flusys/nestjs-shared/modules';
8
- import { Module, Scope } from '@nestjs/common';
8
+ import { Module } from '@nestjs/common';
9
9
  import { JwtModule } from '@nestjs/jwt';
10
10
  import { PassportModule } from '@nestjs/passport';
11
- import { getRepositoryToken } from '@nestjs/typeorm';
12
- import { AuthConfigService } from '../services/auth-config.service';
13
- import { AuthDataSourceProvider } from '../services/auth-datasource.provider';
11
+ import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
14
12
  import { AUTH_MODULE_OPTIONS } from '../config/auth.constants';
15
13
  import { AuthenticationController, BranchController, CompanyController, CompanySelectionController, UserController, UserPermissionController } from '../controllers';
16
14
  import { Company, CompanyBranch, User, UserCompanyPermission } from '../entities';
17
- import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
18
15
  import { ClearToken } from '../interceptors/clear-token.interceptor';
19
16
  import { SetToken } from '../interceptors/set-token.interceptor';
20
17
  import { AuthEmailService, AuthenticationService, BranchService, CompanySelectionSessionService, CompanyService, UserPermissionService, UserService } from '../services';
18
+ import { AuthConfigService } from '../services/auth-config.service';
19
+ import { AuthDataSourceProvider } from '../services/auth-datasource.provider';
21
20
  import { JwtStrategy } from '../strategies/jwt.strategy';
22
21
  export class AuthModule {
23
22
  static forRoot(options) {
24
- return this.buildDynamicModule(options);
23
+ const optionsProvider = {
24
+ provide: AUTH_MODULE_OPTIONS,
25
+ useValue: options
26
+ };
27
+ return this.buildModule(options, [
28
+ optionsProvider,
29
+ ...options.providers ?? []
30
+ ]);
25
31
  }
26
- static forRootAsync(asyncOptions) {
27
- const { global = false, includeController = true, bootstrapAppConfig: { enableCompanyFeature } = {}, imports: externalImports = [], providers: additionalProviders = [] } = asyncOptions;
28
- const asyncProviders = this.createAsyncProviders(asyncOptions);
29
- // Build imports
30
- const imports = [
31
- ...externalImports,
32
- PassportModule.register({
33
- defaultStrategy: 'jwt'
34
- }),
35
- JwtModule.register({}),
36
- CacheModule,
37
- UtilsModule
38
- ];
39
- // Build controllers based on configuration
40
- const controllers = [];
41
- if (includeController) {
42
- // Core authentication controller (always included)
43
- controllers.push(AuthenticationController);
44
- // User controller (always included)
45
- controllers.push(UserController);
46
- // Company feature controllers (conditional)
47
- if (enableCompanyFeature) {
48
- controllers.push(CompanySelectionController, CompanyController, BranchController, UserPermissionController);
49
- }
50
- }
51
- // Build providers
52
- const providers = [
32
+ static forRootAsync(options) {
33
+ const asyncProviders = this.createAsyncProviders(options);
34
+ return this.buildModule(options, [
53
35
  ...asyncProviders,
54
- ...additionalProviders,
55
- // Config & Infrastructure
56
- AuthConfigService,
57
- AuthDataSourceProvider,
58
- // Auth core
59
- JwtStrategy,
60
- JwtAuthGuard,
61
- AuthenticationService,
62
- AuthEmailService,
63
- // Interceptors
64
- SetToken,
65
- ClearToken,
66
- // Core services (always included)
67
- UserService
68
- ];
69
- // Company feature services (conditional)
70
- if (enableCompanyFeature) {
71
- providers.push(CompanySelectionSessionService, CompanyService, BranchService, UserPermissionService);
72
- }
73
- // Build exports
74
- const exports = [
75
- PassportModule,
76
- AUTH_MODULE_OPTIONS,
77
- AuthConfigService,
78
- AuthDataSourceProvider,
79
- JwtStrategy,
80
- JwtAuthGuard,
81
- AuthenticationService,
82
- AuthEmailService,
83
- UserService
84
- ];
85
- if (enableCompanyFeature) {
86
- exports.push(CompanySelectionSessionService, CompanyService, BranchService, UserPermissionService);
87
- }
36
+ ...options.providers ?? []
37
+ ], options.imports);
38
+ }
39
+ /** Build the dynamic module with shared logic */ static buildModule(options, providers, externalImports = []) {
40
+ const { global = false, includeController = true, bootstrapAppConfig } = options;
41
+ const enableCompanyFeature = bootstrapAppConfig?.enableCompanyFeature ?? false;
88
42
  return {
89
43
  module: AuthModule,
90
44
  global,
91
- imports,
92
- controllers,
93
- providers,
94
- exports
45
+ imports: [
46
+ ...externalImports,
47
+ ...this.buildImports()
48
+ ],
49
+ controllers: this.buildControllers(includeController, enableCompanyFeature),
50
+ providers: [
51
+ ...providers,
52
+ ...this.buildProviders(enableCompanyFeature)
53
+ ],
54
+ exports: this.buildExports(enableCompanyFeature)
95
55
  };
96
56
  }
97
- static buildDynamicModule(options) {
98
- const { bootstrapAppConfig: { enableCompanyFeature } = {}, includeController = true, global = false, providers: additionalProviders = [] } = options;
99
- const imports = [
57
+ /** Common module imports */ static buildImports() {
58
+ return [
100
59
  PassportModule.register({
101
60
  defaultStrategy: 'jwt'
102
61
  }),
@@ -104,42 +63,36 @@ export class AuthModule {
104
63
  CacheModule,
105
64
  UtilsModule
106
65
  ];
107
- // Build controllers based on configuration
108
- const controllers = [];
109
- if (includeController) {
110
- // Core authentication controller (always included)
111
- controllers.push(AuthenticationController);
112
- // User controller (always included)
113
- controllers.push(UserController);
114
- // Company feature controllers (conditional)
115
- if (enableCompanyFeature) {
116
- controllers.push(CompanySelectionController, CompanyController, BranchController, UserPermissionController);
117
- }
66
+ }
67
+ /** Build controllers based on feature flags */ static buildControllers(includeController, enableCompanyFeature) {
68
+ if (!includeController) return [];
69
+ const controllers = [
70
+ AuthenticationController,
71
+ UserController
72
+ ];
73
+ if (enableCompanyFeature) {
74
+ controllers.push(CompanySelectionController, CompanyController, BranchController, UserPermissionController);
118
75
  }
76
+ return controllers;
77
+ }
78
+ /** Core providers (without AUTH_MODULE_OPTIONS - that's added separately) */ static buildProviders(enableCompanyFeature) {
119
79
  const providers = [
120
- {
121
- provide: AUTH_MODULE_OPTIONS,
122
- useValue: options
123
- },
124
- ...additionalProviders,
125
- // Config & Infrastructure
126
80
  AuthConfigService,
127
81
  AuthDataSourceProvider,
128
- // Auth core
129
82
  JwtStrategy,
130
83
  JwtAuthGuard,
131
84
  AuthenticationService,
132
85
  AuthEmailService,
133
- // Interceptors
134
86
  SetToken,
135
87
  ClearToken,
136
- // Core services (always included)
137
88
  UserService
138
89
  ];
139
- // Company feature services (conditional)
140
90
  if (enableCompanyFeature) {
141
91
  providers.push(CompanySelectionSessionService, CompanyService, BranchService, UserPermissionService);
142
92
  }
93
+ return providers;
94
+ }
95
+ /** Build module exports */ static buildExports(enableCompanyFeature) {
143
96
  const exports = [
144
97
  PassportModule,
145
98
  AUTH_MODULE_OPTIONS,
@@ -154,16 +107,9 @@ export class AuthModule {
154
107
  if (enableCompanyFeature) {
155
108
  exports.push(CompanySelectionSessionService, CompanyService, BranchService, UserPermissionService);
156
109
  }
157
- return {
158
- module: AuthModule,
159
- global,
160
- imports,
161
- controllers,
162
- providers,
163
- exports
164
- };
110
+ return exports;
165
111
  }
166
- static createAsyncProviders(options) {
112
+ /** Create async providers for forRootAsync */ static createAsyncProviders(options) {
167
113
  const staticOptions = {
168
114
  global: options.global,
169
115
  includeController: options.includeController,
@@ -173,13 +119,10 @@ export class AuthModule {
173
119
  return [
174
120
  {
175
121
  provide: AUTH_MODULE_OPTIONS,
176
- useFactory: async (...args)=>{
177
- const config = await options.useFactory(...args);
178
- return {
122
+ useFactory: async (...args)=>({
179
123
  ...staticOptions,
180
- config
181
- };
182
- },
124
+ config: await options.useFactory(...args)
125
+ }),
183
126
  inject: options.inject || []
184
127
  }
185
128
  ];
@@ -192,13 +135,10 @@ export class AuthModule {
192
135
  },
193
136
  {
194
137
  provide: AUTH_MODULE_OPTIONS,
195
- useFactory: async (factory)=>{
196
- const config = await factory.createAuthOptions();
197
- return {
138
+ useFactory: async (factory)=>({
198
139
  ...staticOptions,
199
- config
200
- };
201
- },
140
+ config: await factory.createAuthOptions()
141
+ }),
202
142
  inject: [
203
143
  options.useClass
204
144
  ]
@@ -209,13 +149,10 @@ export class AuthModule {
209
149
  return [
210
150
  {
211
151
  provide: AUTH_MODULE_OPTIONS,
212
- useFactory: async (factory)=>{
213
- const config = await factory.createAuthOptions();
214
- return {
152
+ useFactory: async (factory)=>({
215
153
  ...staticOptions,
216
- config
217
- };
218
- },
154
+ config: await factory.createAuthOptions()
155
+ }),
219
156
  inject: [
220
157
  options.useExisting
221
158
  ]
@@ -229,35 +166,14 @@ export class AuthModule {
229
166
  }
230
167
  ];
231
168
  }
232
- /**
233
- * Create repository providers that use AuthDataSourceProvider
234
- * This replaces TypeOrmModule.forFeature() functionality
235
- * Note: Must be REQUEST-scoped since AuthDataSourceProvider is REQUEST-scoped
236
- */ static getRepositoryProviders(enableCompanyFeature) {
237
- const entities = this.getEntities(enableCompanyFeature);
238
- return entities.map((entity)=>({
239
- provide: getRepositoryToken(entity),
240
- scope: Scope.REQUEST,
241
- useFactory: async (dataSourceProvider)=>{
242
- return await dataSourceProvider.getRepository(entity);
243
- },
244
- inject: [
245
- AuthDataSourceProvider
246
- ]
247
- }));
248
- }
249
- static getEntities(enableCompanyFeature = false) {
250
- const coreEntities = [
251
- User
252
- ];
253
- const companyEntities = enableCompanyFeature ? [
169
+ /** Get auth entities based on feature flags */ static getEntities(enableCompanyFeature = false) {
170
+ return enableCompanyFeature ? [
171
+ User,
254
172
  Company,
255
173
  CompanyBranch,
256
174
  UserCompanyPermission
257
- ] : [];
258
- return [
259
- ...coreEntities,
260
- ...companyEntities
175
+ ] : [
176
+ User
261
177
  ];
262
178
  }
263
179
  }
@@ -25,30 +25,43 @@ function _ts_param(paramIndex, decorator) {
25
25
  decorator(target, key, paramIndex);
26
26
  };
27
27
  }
28
- import { Inject, Injectable, Optional } from '@nestjs/common';
29
- import { AuthModuleOptions } from '../interfaces/auth-module-options.interface';
28
+ import { Inject, Injectable, InternalServerErrorException, Logger, Optional } from '@nestjs/common';
30
29
  import { AUTH_MODULE_OPTIONS } from '../config/auth.constants';
30
+ import { AuthModuleOptions } from '../interfaces/auth-module-options.interface';
31
31
  export class AuthConfigService {
32
- // Database Mode
33
- /** Get database mode (single or multi-tenant) */ getDatabaseMode() {
32
+ // Database Mode (required by IModuleConfigService)
33
+ getDatabaseMode() {
34
34
  return this.options.bootstrapAppConfig?.databaseMode ?? 'single';
35
35
  }
36
- /** Check if running in multi-tenant mode */ isMultiTenant() {
36
+ isMultiTenant() {
37
37
  return this.getDatabaseMode() === 'multi-tenant';
38
38
  }
39
39
  // Feature Flags
40
- /** Check if company feature is enabled */ isCompanyFeatureEnabled() {
40
+ isCompanyFeatureEnabled() {
41
41
  return this.options.bootstrapAppConfig?.enableCompanyFeature ?? false;
42
42
  }
43
43
  // JWT Configuration
44
44
  /** Get JWT secret key */ getJwtSecret() {
45
- return this.config.jwtSecret ?? 'default-secret-change-in-production';
45
+ if (!this.config.jwtSecret) {
46
+ throw new InternalServerErrorException('[AuthModule] JWT_SECRET is required - set via environment or module config');
47
+ }
48
+ return this.config.jwtSecret;
46
49
  }
47
50
  /** Get JWT expiration time */ getJwtExpiration() {
48
51
  return this.config.jwtExpiration ?? '1h';
49
52
  }
50
53
  /** Get refresh token secret key */ getRefreshTokenSecret() {
51
- return this.config.refreshTokenSecret ?? this.getJwtSecret();
54
+ if (this.config.refreshTokenSecret) {
55
+ return this.config.refreshTokenSecret;
56
+ }
57
+ if (process.env.NODE_ENV === 'production') {
58
+ throw new InternalServerErrorException('[AuthModule] REFRESH_TOKEN_SECRET is required in production - ' + 'using the same secret for access and refresh tokens is a security risk');
59
+ }
60
+ if (!this.refreshTokenSecretWarned) {
61
+ this.refreshTokenSecretWarned = true;
62
+ this.logger.warn('REFRESH_TOKEN_SECRET not configured - using JWT_SECRET as fallback. ' + 'For better security, configure a separate refresh token secret.');
63
+ }
64
+ return this.getJwtSecret();
52
65
  }
53
66
  /** Get refresh token expiration time */ getRefreshTokenExpiration() {
54
67
  return this.config.refreshTokenExpiration ?? '7d';
@@ -60,30 +73,11 @@ export class AuthConfigService {
60
73
  /** Get frontend URL for email links */ getFrontendUrl() {
61
74
  return this.config.frontendUrl;
62
75
  }
63
- // Database Configuration
64
- /** Get default database config */ getDefaultDatabaseConfig() {
65
- return this.config.defaultDatabaseConfig ?? this.config.tenantDefaultDatabaseConfig;
66
- }
67
- /** Get tenant default database config (for multi-tenant) */ getTenantDefaultDatabaseConfig() {
68
- return this.config.tenantDefaultDatabaseConfig;
69
- }
70
- /** Get registered tenants */ getTenants() {
71
- return this.config.tenants ?? [];
72
- }
73
- // Raw Options
74
- /** Get full module options */ getOptions() {
75
- return {
76
- ...this.options
77
- };
78
- }
79
- /** Get runtime config */ getConfig() {
80
- return {
81
- ...this.config
82
- };
83
- }
84
76
  constructor(injectedOptions){
77
+ _define_property(this, "logger", new Logger(AuthConfigService.name));
85
78
  _define_property(this, "options", void 0);
86
79
  _define_property(this, "config", void 0);
80
+ _define_property(this, "refreshTokenSecretWarned", false);
87
81
  this.options = injectedOptions ?? {
88
82
  global: false,
89
83
  includeController: true
@@ -26,7 +26,7 @@ function _ts_param(paramIndex, decorator) {
26
26
  };
27
27
  }
28
28
  import { MultiTenantDataSourceService } from '@flusys/nestjs-shared/modules';
29
- import { Inject, Injectable, Logger, Optional, Scope } from '@nestjs/common';
29
+ import { Inject, Injectable, InternalServerErrorException, Logger, Optional, Scope } from '@nestjs/common';
30
30
  import { REQUEST } from '@nestjs/core';
31
31
  import { Request } from 'express';
32
32
  import { AuthModuleOptions } from '../interfaces/auth-module-options.interface';
@@ -41,7 +41,7 @@ export class AuthDataSourceProvider extends MultiTenantDataSourceService {
41
41
  const lockPromise = (async ()=>{
42
42
  const config = this.getDefaultDatabaseConfig();
43
43
  if (!config) {
44
- throw new Error('Default database config is not available');
44
+ throw new InternalServerErrorException('Default database config is not available');
45
45
  }
46
46
  const ds = await this.createDataSourceFromConfig(config);
47
47
  AuthDataSourceProvider.singleDataSource = ds;
@@ -90,40 +90,28 @@ export class AuthDataSourceProvider extends MultiTenantDataSourceService {
90
90
  };
91
91
  }
92
92
  // Feature Flags
93
- /** Get global enable company feature flag */ getEnableCompanyFeature() {
94
- return this.authOptions.bootstrapAppConfig?.enableCompanyFeature ?? false;
95
- }
96
- /** Get enable company feature for specific tenant. Falls back to global setting. */ getEnableCompanyFeatureForTenant(tenant) {
97
- return tenant?.enableCompanyFeature ?? this.getEnableCompanyFeature();
98
- }
99
- /** Get enable company feature for current request context */ getEnableCompanyFeatureForCurrentTenant() {
100
- return this.getEnableCompanyFeatureForTenant(this.getCurrentTenant() ?? undefined);
93
+ /** Check if company feature is enabled (tenant-specific or global fallback) */ isCompanyFeatureEnabled(tenant) {
94
+ const effectiveTenant = tenant ?? this.getCurrentTenant();
95
+ return effectiveTenant?.enableCompanyFeature ?? this.authOptions.bootstrapAppConfig?.enableCompanyFeature ?? false;
101
96
  }
102
97
  // Entity Management
103
- /** Get auth entities based on company feature flag */ async getAuthEntities(enableCompanyFeature) {
104
- const enable = enableCompanyFeature ?? this.getEnableCompanyFeature();
98
+ /** Get auth entities based on company feature flag */ async getAuthEntities() {
105
99
  const { Company, CompanyBranch, User, UserCompanyPermission, UserToken, PendingRegistration } = await import('../entities');
106
100
  const coreEntities = [
107
101
  User,
108
102
  UserToken,
109
103
  PendingRegistration
110
104
  ];
111
- const companyEntities = enable ? [
105
+ return this.isCompanyFeatureEnabled() ? [
106
+ ...coreEntities,
112
107
  Company,
113
108
  CompanyBranch,
114
109
  UserCompanyPermission
115
- ] : [];
116
- return [
117
- ...coreEntities,
118
- ...companyEntities
119
- ];
110
+ ] : coreEntities;
120
111
  }
121
112
  // Overrides
122
113
  /** Override to dynamically set entities based on tenant config */ async createDataSourceFromConfig(config) {
123
- const currentTenant = this.getCurrentTenant();
124
- const enableCompanyFeature = this.getEnableCompanyFeatureForTenant(currentTenant ?? undefined);
125
- const entities = await this.getAuthEntities(enableCompanyFeature);
126
- return super.createDataSourceFromConfig(config, entities);
114
+ return super.createDataSourceFromConfig(config, await this.getAuthEntities());
127
115
  }
128
116
  constructor(authOptions, request){
129
117
  super(AuthDataSourceProvider.buildParentOptions(authOptions), request), _define_property(this, "authOptions", void 0), _define_property(this, "logger", void 0), this.authOptions = authOptions, this.logger = new Logger(AuthDataSourceProvider.name);