@newheap/platform-common 1.3.0 → 1.4.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.
package/README.md CHANGED
@@ -43,3 +43,25 @@ import { NhCommonModule } from '@newheap/platform-common';
43
43
  })
44
44
  export class AppModule {}
45
45
  ```
46
+
47
+ ## Two-factor components
48
+
49
+ `BaseNhAuthService` covers the two-factor API: challenges, required enrollment, e-mail codes,
50
+ remembered devices, passkeys and account settings. The optional standalone components live in a
51
+ separate entry point, so applications that do not import it ship none of their code:
52
+
53
+ ```typescript
54
+ import {
55
+ NhPasskeyLoginButtonComponent,
56
+ NhTwoFactorChallengeComponent,
57
+ NhTwoFactorEnrollmentComponent,
58
+ NhTwoFactorSettingsComponent
59
+ } from '@newheap/platform-common/two-factor';
60
+ ```
61
+
62
+ The components inject `NhAuthService` and add their English and Dutch texts under
63
+ `nh-two-factor.`; keys the application defines win. The bundles are also available as
64
+ `@newheap/platform-common/two-factor/i18n/en.json` and `nl.json`. Call `provideNhTwoFactor()`
65
+ to register the texts at startup when a custom login page translates the `nh-two-factor.`
66
+ failure keys without the components. The authenticator QR code is a PNG data URI, so a Content
67
+ Security Policy must allow `img-src data:`.