ecrs-auth-core 1.0.33 → 1.0.34
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.d.ts +2 -2
- package/dist/auth.module.js +12 -8
- package/package.json +1 -1
package/dist/auth.module.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DynamicModule } from
|
|
2
|
-
import { AuthCoreOptions } from
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { AuthCoreOptions } from "./interfaces/auth-core-options.interface";
|
|
3
3
|
export declare const AUTH_CORE_OPTIONS = "AUTH_CORE_OPTIONS";
|
|
4
4
|
export declare class AuthCoreModule {
|
|
5
5
|
static registerAsync(options: {
|
package/dist/auth.module.js
CHANGED
|
@@ -19,7 +19,7 @@ const roles_guard_1 = require("./guards/roles.guard");
|
|
|
19
19
|
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
|
-
exports.AUTH_CORE_OPTIONS =
|
|
22
|
+
exports.AUTH_CORE_OPTIONS = "AUTH_CORE_OPTIONS";
|
|
23
23
|
let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
|
|
24
24
|
static registerAsync(options) {
|
|
25
25
|
const asyncProvider = {
|
|
@@ -33,20 +33,24 @@ let AuthCoreModule = AuthCoreModule_1 = class AuthCoreModule {
|
|
|
33
33
|
providers: [
|
|
34
34
|
asyncProvider,
|
|
35
35
|
{
|
|
36
|
-
provide:
|
|
37
|
-
useFactory: async (options) =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
provide: "ASYNC_JWT_OPTIONS",
|
|
37
|
+
useFactory: async (options) => {
|
|
38
|
+
console.log("🔐 JWT Secret from AUTH_CORE_OPTIONS:", options.jwtSecret);
|
|
39
|
+
console.log("⏳ JWT Expiry:", options.jwtExpiresIn);
|
|
40
|
+
return {
|
|
41
|
+
secret: options.jwtSecret,
|
|
42
|
+
signOptions: { expiresIn: options.jwtExpiresIn },
|
|
43
|
+
};
|
|
44
|
+
},
|
|
41
45
|
inject: [exports.AUTH_CORE_OPTIONS],
|
|
42
46
|
},
|
|
43
47
|
{
|
|
44
48
|
provide: jwt_1.JwtModule,
|
|
45
49
|
useFactory: async (jwtOptions) => jwt_1.JwtModule.register(jwtOptions),
|
|
46
|
-
inject: [
|
|
50
|
+
inject: ["ASYNC_JWT_OPTIONS"],
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
|
-
provide:
|
|
53
|
+
provide: "MODULE_CONFIG",
|
|
50
54
|
useFactory: (options) => options.moduleConfig || {},
|
|
51
55
|
inject: [exports.AUTH_CORE_OPTIONS],
|
|
52
56
|
},
|