@flusys/ng-auth 8.1.5 → 9.0.1
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 +11 -0
- package/fesm2022/flusys-ng-auth.mjs +315 -307
- package/fesm2022/flusys-ng-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/flusys-ng-auth.d.ts +56 -28
package/README.md
CHANGED
|
@@ -180,6 +180,17 @@ providers: [
|
|
|
180
180
|
]
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
+
### Password policy
|
|
184
|
+
|
|
185
|
+
Every page that **sets** a password (register, reset password, change password, admin user form) validates through `PasswordPolicyService`, which defaults to `DEFAULT_PASSWORD_VALIDATION` — the same rule as the backend `@IsStrongPassword()` (8–128 chars, uppercase, lowercase, number, special character). `AUTH_VALIDATION_CONFIG.password` is merged over those defaults, so set only what you want to change; keep it at least as strict as the backend or the API will reject what the form accepts. The login page only requires a non-empty password, so accounts created under an older policy can still sign in.
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
readonly passwordPolicy = inject(PasswordPolicyService);
|
|
189
|
+
readonly passwordError = computed(() => this.passwordPolicy.validate(this.model().password)); // translated message or null
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Email fields (login, register) validate through `EmailPolicyService` the same way: it applies `AUTH_VALIDATION_CONFIG.email` (`pattern`, `messageKey`/`message`, `messageParam`) and returns a translated message or `null`.
|
|
193
|
+
|
|
183
194
|
## License
|
|
184
195
|
|
|
185
196
|
MIT © FLUSYS
|