nestjs-security-cli 1.3.4 → 1.3.5
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/README.md +8 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,10 +70,14 @@ import { SecurityModule, BlacklistedIp, BlacklistedIpSchema } from 'nestjs-secur
|
|
|
70
70
|
{ name: BlacklistedIp.name, schema: BlacklistedIpSchema }
|
|
71
71
|
] ),
|
|
72
72
|
// Security module
|
|
73
|
-
SecurityModule.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
SecurityModule.forRootAsync( {
|
|
74
|
+
enableAdminPanel: true,
|
|
75
|
+
useFactory: (configService: ConfigService) => ({
|
|
76
|
+
enableDatabase: true,
|
|
77
|
+
defaultBlockDurationHours: 24,
|
|
78
|
+
enableAutoBlocking: true
|
|
79
|
+
}),
|
|
80
|
+
inject: [ ConfigService ]
|
|
77
81
|
} )
|
|
78
82
|
]
|
|
79
83
|
} )
|
|
@@ -81,20 +85,6 @@ export class AppModule {
|
|
|
81
85
|
}
|
|
82
86
|
```
|
|
83
87
|
|
|
84
|
-
## With forRootAsync
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
SecurityModule.forRootAsync( {
|
|
88
|
-
enableAdminPanel: true,
|
|
89
|
-
useFactory: (configService: ConfigService) => ({
|
|
90
|
-
enableDatabase: true,
|
|
91
|
-
defaultBlockDurationHours: 24,
|
|
92
|
-
enableAutoBlocking: true
|
|
93
|
-
}),
|
|
94
|
-
inject: [ ConfigService ]
|
|
95
|
-
} )
|
|
96
|
-
```
|
|
97
|
-
|
|
98
88
|
## Cache-Only Mode (No Database)
|
|
99
89
|
|
|
100
90
|
If you don't want to use MongoDB, you can skip the schema registration:
|
package/package.json
CHANGED