@adminforth/two-factors-auth 1.9.2 → 1.10.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/types.ts CHANGED
@@ -16,7 +16,68 @@ export type PluginOptions = {
16
16
  */
17
17
  timeStepWindow?: number;
18
18
 
19
- customBrendPrefix?: string;
19
+ customBrandPrefix?: string;
20
+
21
+ /**
22
+ * Passkeys (WebAuthn) configuration.
23
+ */
24
+ passkeys?: {
25
+ credentialResourceID: string,
26
+ credentialIdFieldName: string,
27
+ credentialMetaFieldName: string,
28
+ credentialUserIdFieldName: string,
29
+ /**
30
+ * Period between showing alert suggesting to set up Passkeys if not set up yet.
31
+ */
32
+ suggestionPeriod?: string; // e.g. '30d', '12h', '15m'. Default is '5d'
33
+ /**
34
+ * Passkeys settings for WebAuthn API.
35
+ */
36
+ settings: {
37
+ /**
38
+ * The origin that you expect the authentication to come from. (e.g. https://example.com or http://localhost:3000)
39
+ */
40
+ expectedOrigin: string;
41
+ rp?: {
42
+ /**
43
+ * The Relying Party name.
44
+ */
45
+ name?: string;
46
+ /**
47
+ * The Relying Party ID. A domain or subdomain (e.g. example.com or login.example.com).
48
+ */
49
+ id?: string;
50
+ },
51
+ user: {
52
+ /**
53
+ * Field in users resource, that user will recognize as unique user ID.(e.g. email or username)
54
+ */
55
+ nameField: string;
56
+ /**
57
+ * Field in users resource, that user will recognize as display name.(e.g. full name)
58
+ */
59
+ displayNameField?: string;
60
+ },
61
+ authenticatorSelection?: {
62
+ /**
63
+ * The preferred authenticator attachment. It can be either "platform", "cross-platform" or "both".
64
+ * Default to "platform".
65
+ */
66
+ authenticatorAttachment?: 'platform' | 'cross-platform' | 'both';
67
+ /**
68
+ * Set it to a boolean true. A discoverable credential (resident key)
69
+ * stores user information to the passkey and lets users select the account upon authentication.
70
+ * Default to "True".
71
+ */
72
+ requireResidentKey?: boolean;
73
+ /**
74
+ * Indicates whether a user verification using the device screen lock is "required" or "discouraged".
75
+ * The default is "required".
76
+ */
77
+ userVerification?: 'required' | 'discouraged';
78
+ }
79
+ };
80
+ };
20
81
 
21
82
  /**
22
83
  * Optional function to filter users to apply 2FA.