ecrs-auth-core 1.0.31 → 1.0.32
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/auth.module.js +16 -17
- package/package.json +1 -1
package/dist/auth.module.js
CHANGED
|
@@ -22,29 +22,28 @@ 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 registerAsync(options) {
|
|
25
|
-
const
|
|
25
|
+
const authCoreOptionsProvider = {
|
|
26
26
|
provide: exports.AUTH_CORE_OPTIONS,
|
|
27
27
|
inject: options.inject,
|
|
28
28
|
useFactory: options.useFactory,
|
|
29
29
|
};
|
|
30
30
|
return {
|
|
31
31
|
module: AuthCoreModule_1,
|
|
32
|
-
imports: [
|
|
33
|
-
|
|
34
|
-
asyncProvider,
|
|
35
|
-
{
|
|
36
|
-
provide: 'ASYNC_JWT_OPTIONS',
|
|
37
|
-
useFactory: async (options) => ({
|
|
38
|
-
secret: options.jwtSecret,
|
|
39
|
-
signOptions: { expiresIn: options.jwtExpiresIn },
|
|
40
|
-
}),
|
|
32
|
+
imports: [
|
|
33
|
+
jwt_1.JwtModule.registerAsync({
|
|
41
34
|
inject: [exports.AUTH_CORE_OPTIONS],
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
useFactory: async (options) => {
|
|
36
|
+
console.log('✅ JWT_SECRET:', options.jwtSecret);
|
|
37
|
+
console.log('✅ JWT_EXPIRES_IN:', options.jwtExpiresIn);
|
|
38
|
+
return {
|
|
39
|
+
secret: options.jwtSecret,
|
|
40
|
+
signOptions: { expiresIn: options.jwtExpiresIn },
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
providers: [
|
|
46
|
+
authCoreOptionsProvider,
|
|
48
47
|
{
|
|
49
48
|
provide: 'MODULE_CONFIG',
|
|
50
49
|
useFactory: (options) => options.moduleConfig || {},
|
|
@@ -62,8 +61,8 @@ let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
|
|
|
62
61
|
controllers: [auth_controller_1.AuthController],
|
|
63
62
|
exports: [
|
|
64
63
|
auth_service_1.AuthService,
|
|
65
|
-
jwt_strategy_1.JwtStrategy,
|
|
66
64
|
jwt_guard_1.JwtAuthGuard,
|
|
65
|
+
jwt_strategy_1.JwtStrategy,
|
|
67
66
|
module_guard_1.ModuleGuard,
|
|
68
67
|
roles_guard_1.RolesGuard,
|
|
69
68
|
feature_guard_1.FeatureGuard,
|