@reachfive/identity-ui 1.24.0 → 1.25.2
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/cjs/identity-ui.js +11250 -13434
- package/cjs/identity-ui.js.map +1 -0
- package/es/identity-ui.js +11351 -13548
- package/es/identity-ui.js.map +1 -0
- package/es/identity-ui.min.js +469 -0
- package/es/identity-ui.min.js.map +1 -0
- package/package.json +55 -31
- package/types/identity-ui.d.ts +1037 -0
- package/umd/identity-ui.js +60474 -62365
- package/umd/identity-ui.js.map +1 -0
- package/umd/identity-ui.min.js +475 -1
- package/umd/identity-ui.min.js.map +1 -0
- package/CHANGELOG.md +0 -490
- package/index.d.ts +0 -483
|
@@ -0,0 +1,1037 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @reachfive/identity-ui - v1.25.2
|
|
3
|
+
* Compiled Wed, 21 Feb 2024 14:45:45 UTC
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) ReachFive.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
**/
|
|
10
|
+
import { Config as Config$1, RemoteSettings, ConsentVersions, CustomField, Client as Client$1, SessionInfo, AuthOptions, MFA, PasswordlessResponse, SingleFactorPasswordlessParams, Profile, UserConsent, DeviceCredential } from '@reachfive/identity-core';
|
|
11
|
+
export { Config } from '@reachfive/identity-core';
|
|
12
|
+
import CSS from 'csstype';
|
|
13
|
+
import React$1 from 'react';
|
|
14
|
+
import { PasswordlessParams } from '@reachfive/identity-core/es/main/oAuthClient';
|
|
15
|
+
|
|
16
|
+
type Prettify<T> = {
|
|
17
|
+
[K in keyof T]: T[K]
|
|
18
|
+
} & {}
|
|
19
|
+
|
|
20
|
+
type RecursivePartial<T> = {
|
|
21
|
+
[P in keyof T]?: RecursivePartial<T[P]>
|
|
22
|
+
} & {}
|
|
23
|
+
|
|
24
|
+
type RequiredProperty<T, K extends keyof T> = T & {
|
|
25
|
+
[P in K]-?: T[P];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type ConsentsVersions = { consentsVersions: Record<string, ConsentVersions> }
|
|
29
|
+
|
|
30
|
+
type CustomFields = { customFields?: CustomField[] }
|
|
31
|
+
|
|
32
|
+
type Config = Config$1 & RemoteSettings & ConsentsVersions & CustomFields
|
|
33
|
+
|
|
34
|
+
declare const inputBtnFocusBoxShadow: (borderColor?: string) => string | undefined;
|
|
35
|
+
|
|
36
|
+
declare module 'styled-components' {
|
|
37
|
+
export interface DefaultTheme extends Theme {}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type ThemeOptions = RecursivePartial<Theme>
|
|
41
|
+
|
|
42
|
+
interface BaseTheme {
|
|
43
|
+
/**
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
animateWidgetEntrance: boolean
|
|
47
|
+
/** Specifies the font-size.
|
|
48
|
+
* @default 14
|
|
49
|
+
*/
|
|
50
|
+
fontSize: number
|
|
51
|
+
/** Specifies the font-size for small texts.
|
|
52
|
+
* @default 12
|
|
53
|
+
*/
|
|
54
|
+
smallTextFontSize: number
|
|
55
|
+
/** Specifies the line-height.
|
|
56
|
+
* @default 1.428571429
|
|
57
|
+
*/
|
|
58
|
+
lineHeight: number
|
|
59
|
+
/**
|
|
60
|
+
* @default "#212529"
|
|
61
|
+
*/
|
|
62
|
+
headingColor: CSS.Color
|
|
63
|
+
/**
|
|
64
|
+
* @default "#495057"
|
|
65
|
+
*/
|
|
66
|
+
textColor: CSS.Color
|
|
67
|
+
/**
|
|
68
|
+
* @default "#adb5bd"
|
|
69
|
+
*/
|
|
70
|
+
mutedTextColor: CSS.Color
|
|
71
|
+
/**
|
|
72
|
+
* @default "3"
|
|
73
|
+
*/
|
|
74
|
+
borderRadius: number
|
|
75
|
+
/**
|
|
76
|
+
* @default "#ced4da "
|
|
77
|
+
*/
|
|
78
|
+
borderColor: CSS.Color
|
|
79
|
+
/**
|
|
80
|
+
* @default 1
|
|
81
|
+
*/
|
|
82
|
+
borderWidth: number
|
|
83
|
+
/**
|
|
84
|
+
* @default "#ffffff"
|
|
85
|
+
*/
|
|
86
|
+
backgroundColor: CSS.Color
|
|
87
|
+
/**
|
|
88
|
+
* The button and link default color.
|
|
89
|
+
* @default "#229955"
|
|
90
|
+
*/
|
|
91
|
+
primaryColor: CSS.Color
|
|
92
|
+
/**
|
|
93
|
+
* @default "#dc4e41"
|
|
94
|
+
*/
|
|
95
|
+
dangerColor: CSS.Color
|
|
96
|
+
/**
|
|
97
|
+
* @default "#ffc107"
|
|
98
|
+
*/
|
|
99
|
+
warningColor: CSS.Color
|
|
100
|
+
/**
|
|
101
|
+
* @default "#229955"
|
|
102
|
+
*/
|
|
103
|
+
successColor: CSS.Color
|
|
104
|
+
/**
|
|
105
|
+
* @default "#e9ecef"
|
|
106
|
+
*/
|
|
107
|
+
lightBackgroundColor: CSS.Color
|
|
108
|
+
/** Specifies the padding for the x axis. (left and right) */
|
|
109
|
+
paddingX: number
|
|
110
|
+
/** Specifies the padding for the y axis. (top and bottom) */
|
|
111
|
+
paddingY: number
|
|
112
|
+
spacing: number
|
|
113
|
+
/**
|
|
114
|
+
* @default 400
|
|
115
|
+
*/
|
|
116
|
+
maxWidth: number
|
|
117
|
+
_absoluteLineHeight: number
|
|
118
|
+
_blockInnerHeight: number
|
|
119
|
+
_blockHeight: number
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface LinkTheme {
|
|
123
|
+
color: CSS.Color
|
|
124
|
+
decoration: CSS.TextDecorationLineProperty
|
|
125
|
+
hoverColor: CSS.Color
|
|
126
|
+
hoverDecoration: CSS.TextDecorationLineProperty
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface InputTheme {
|
|
130
|
+
color: CSS.Color
|
|
131
|
+
placeholderColor: CSS.Color
|
|
132
|
+
fontSize: number
|
|
133
|
+
lineHeight: number
|
|
134
|
+
paddingX: number
|
|
135
|
+
paddingY: number
|
|
136
|
+
borderRadius: number
|
|
137
|
+
borderColor: CSS.Color
|
|
138
|
+
borderWidth: number
|
|
139
|
+
background: CSS.Color
|
|
140
|
+
disabledBackground: CSS.Color
|
|
141
|
+
boxShadow: string
|
|
142
|
+
focusBorderColor: CSS.Color
|
|
143
|
+
focusBoxShadow: typeof inputBtnFocusBoxShadow
|
|
144
|
+
height: number
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface ButtonTheme {
|
|
148
|
+
/** Specifies the font-weight (such as normal, bold, or 900).
|
|
149
|
+
* @default 'bold'
|
|
150
|
+
*/
|
|
151
|
+
fontWeight: CSS.FontWeightProperty
|
|
152
|
+
/** Specifies the font-size. */
|
|
153
|
+
fontSize: number
|
|
154
|
+
/** Specifies the line-height. */
|
|
155
|
+
lineHeight: number
|
|
156
|
+
/** Specifies the padding for the x axis. (left and right) */
|
|
157
|
+
paddingX: number
|
|
158
|
+
/** Specifies the padding for the y axis. (top and bottom) */
|
|
159
|
+
paddingY: number
|
|
160
|
+
/** Specifies the border-radius. */
|
|
161
|
+
borderRadius: number
|
|
162
|
+
/** Specifies the border-width. */
|
|
163
|
+
borderWidth: number
|
|
164
|
+
/** Function that specifies the box shadow based on the border color. */
|
|
165
|
+
focusBoxShadow: typeof inputBtnFocusBoxShadow
|
|
166
|
+
/** Specifies the height. */
|
|
167
|
+
height: number
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface SocialButtonTheme {
|
|
171
|
+
/** Boolean that specifies if the buttons are inline (horizonally-aligned). */
|
|
172
|
+
inline: boolean
|
|
173
|
+
/** Boolean that specifies if the text is visible. */
|
|
174
|
+
textVisible: boolean
|
|
175
|
+
/** Specifies the font-weight (such as normal, bold, or 900). */
|
|
176
|
+
fontWeight: CSS.FontWeightProperty
|
|
177
|
+
/** Specifies the font-size. */
|
|
178
|
+
fontSize: number
|
|
179
|
+
/** Specifies the line-height. */
|
|
180
|
+
lineHeight: number
|
|
181
|
+
/** Specifies the padding for the x axis. (left and right) */
|
|
182
|
+
paddingX: number
|
|
183
|
+
/** Specifies the padding for the y axis. (top and bottom) */
|
|
184
|
+
paddingY: number
|
|
185
|
+
/** Specifies the border-radius. */
|
|
186
|
+
borderRadius: number
|
|
187
|
+
/** Specifies the border-width. */
|
|
188
|
+
borderWidth: number
|
|
189
|
+
/** Function that specifies the box shadow based on the border color. */
|
|
190
|
+
focusBoxShadow: typeof inputBtnFocusBoxShadow
|
|
191
|
+
/** Specifies the height. */
|
|
192
|
+
height: number
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface PasswordStrengthTheme {
|
|
196
|
+
color0: CSS.Color
|
|
197
|
+
color1: CSS.Color
|
|
198
|
+
color2: CSS.Color
|
|
199
|
+
color3: CSS.Color
|
|
200
|
+
color4: CSS.Color
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface Theme extends BaseTheme {
|
|
204
|
+
link: LinkTheme
|
|
205
|
+
input: InputTheme
|
|
206
|
+
/** Button theming options. */
|
|
207
|
+
button: ButtonTheme
|
|
208
|
+
/** Social button theming options. */
|
|
209
|
+
socialButton: SocialButtonTheme
|
|
210
|
+
passwordStrengthValidator: PasswordStrengthTheme
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
type I18nMessages = {
|
|
214
|
+
[k: string]: string;
|
|
215
|
+
};
|
|
216
|
+
type I18nMessageParams = Record<string, unknown>;
|
|
217
|
+
type I18nResolver$1 = (key: string, params?: I18nMessageParams) => string;
|
|
218
|
+
|
|
219
|
+
type I18nProps$1 = {
|
|
220
|
+
i18n?: I18nMessages;
|
|
221
|
+
};
|
|
222
|
+
type ThemeProps = {
|
|
223
|
+
theme?: ThemeOptions;
|
|
224
|
+
};
|
|
225
|
+
type Context = {
|
|
226
|
+
config: Config;
|
|
227
|
+
apiClient: Client$1;
|
|
228
|
+
defaultI18n: I18nMessages;
|
|
229
|
+
session?: SessionInfo;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
interface I18nProps {
|
|
233
|
+
i18n: I18nResolver$1;
|
|
234
|
+
}
|
|
235
|
+
type WithI18n<P> = P & I18nProps;
|
|
236
|
+
|
|
237
|
+
type VaildatorError = {
|
|
238
|
+
error: string;
|
|
239
|
+
};
|
|
240
|
+
type ValidatorSuccess = {
|
|
241
|
+
success?: true;
|
|
242
|
+
};
|
|
243
|
+
type VaildatorResult = boolean | VaildatorError | ValidatorSuccess;
|
|
244
|
+
|
|
245
|
+
type FormValue<T> = T | RichFormValue<T>;
|
|
246
|
+
type RichFormValue<T, K extends string = 'raw'> = {
|
|
247
|
+
[P in K]: T;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
interface FieldCreateProps {
|
|
251
|
+
showLabel: boolean
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface FieldCreator<T, P extends FieldComponentProps<T> = FieldComponentProps<T>, S = {}> {
|
|
255
|
+
path: string,
|
|
256
|
+
create: (options: WithI18n<FieldCreateProps>) => Field$1<T, P, S>
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface Field$1<T, P extends FieldComponentProps<T>, S = {}> {
|
|
260
|
+
key: string
|
|
261
|
+
render: (props: P & { state: S }) => React.ReactNode
|
|
262
|
+
initialize: (model: Record<string, unknown>) => FieldValue<T>
|
|
263
|
+
unbind: <M extends Record<string, unknown>>(model: M, state: P) => M
|
|
264
|
+
validate: (data: P, ctx: { isSubmitted: boolean }) => VaildatorResult
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
type FieldValue<T> = {
|
|
268
|
+
value: T | null,
|
|
269
|
+
isDirty: boolean
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
type FieldComponentProps<T, P = {}> = P & {
|
|
273
|
+
inputId: string
|
|
274
|
+
key: string
|
|
275
|
+
path: string
|
|
276
|
+
label: string
|
|
277
|
+
required?: boolean
|
|
278
|
+
readOnly?: boolean
|
|
279
|
+
i18n: I18nResolver
|
|
280
|
+
showLabel?: boolean
|
|
281
|
+
value?: FormValue<T>
|
|
282
|
+
validation?: VaildatorResult
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** The field's representation. */
|
|
286
|
+
type Field = {
|
|
287
|
+
key: string
|
|
288
|
+
label?: string
|
|
289
|
+
required?: boolean
|
|
290
|
+
type?: 'hidden' | 'text' | 'number' | 'email' | 'tel'
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
type LoginViewProps = {
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated
|
|
296
|
+
*/
|
|
297
|
+
acceptTos?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Boolean that specifies whether an additional field for the custom identifier is shown.
|
|
300
|
+
*
|
|
301
|
+
* @default false
|
|
302
|
+
*/
|
|
303
|
+
allowCustomIdentifier?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Boolean that specifies if the forgot password option is enabled.
|
|
306
|
+
*
|
|
307
|
+
* If the `allowLogin` and `allowSignup` properties are set to `false`, the forgot password feature is enabled even if `allowForgotPassword` is set to `false`.
|
|
308
|
+
*
|
|
309
|
+
* @default true
|
|
310
|
+
*/
|
|
311
|
+
allowForgotPassword?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Boolean that specifies whether signup is enabled.
|
|
314
|
+
*
|
|
315
|
+
* @default true
|
|
316
|
+
*/
|
|
317
|
+
allowSignup?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* List of authentication options
|
|
320
|
+
*/
|
|
321
|
+
auth?: AuthOptions;
|
|
322
|
+
/**
|
|
323
|
+
* Whether or not to provide the display password in clear text option.
|
|
324
|
+
*
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
canShowPassword?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Boolean that specifies whether reCAPTCHA is enabled or not.
|
|
330
|
+
*/
|
|
331
|
+
recaptcha_enabled?: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup.
|
|
334
|
+
* This must be paired with the appropriate secret key that you received when setting up reCAPTCHA.
|
|
335
|
+
*/
|
|
336
|
+
recaptcha_site_key?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
339
|
+
*
|
|
340
|
+
* @default false
|
|
341
|
+
*/
|
|
342
|
+
showLabels?: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Whether the Remember me checkbox is displayed on the login view. Affects user session duration.
|
|
345
|
+
*
|
|
346
|
+
* The account session duration configured in the ReachFive Console (Settings Security SSO) applies when:
|
|
347
|
+
* - The checkbox is hidden from the user
|
|
348
|
+
* - The checkbox is visible and selected by the user
|
|
349
|
+
*
|
|
350
|
+
* If the checkbox is visible and not selected by the user, the default session duration of 1 day applies.
|
|
351
|
+
*
|
|
352
|
+
* @default false
|
|
353
|
+
*/
|
|
354
|
+
showRememberMe?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Lists the available social providers. This is an array of strings.
|
|
357
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
358
|
+
*/
|
|
359
|
+
socialProviders?: string[];
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
interface LoginWithWebAuthnViewProps {
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated
|
|
365
|
+
*/
|
|
366
|
+
acceptTos?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Boolean that specifies whether signup is enabled.
|
|
369
|
+
*
|
|
370
|
+
* @default true
|
|
371
|
+
*/
|
|
372
|
+
allowSignup?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* List of authentication options
|
|
375
|
+
*/
|
|
376
|
+
auth?: AuthOptions;
|
|
377
|
+
/**
|
|
378
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
379
|
+
*
|
|
380
|
+
* @default false
|
|
381
|
+
*/
|
|
382
|
+
showLabels?: boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Lists the available social providers. This is an array of strings.
|
|
385
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
386
|
+
*/
|
|
387
|
+
socialProviders?: string[];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
interface LoginWithPasswordViewProps {
|
|
391
|
+
allowForgotPassword?: boolean;
|
|
392
|
+
auth?: AuthOptions;
|
|
393
|
+
canShowPassword?: boolean;
|
|
394
|
+
recaptcha_enabled?: boolean;
|
|
395
|
+
recaptcha_site_key?: string;
|
|
396
|
+
showLabels?: boolean;
|
|
397
|
+
showRememberMe?: boolean;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
interface PasswordSignupFormProps {
|
|
401
|
+
auth?: AuthOptions;
|
|
402
|
+
beforeSignup?: <T>(param: T) => T;
|
|
403
|
+
canShowPassword?: boolean;
|
|
404
|
+
recaptcha_enabled?: boolean;
|
|
405
|
+
recaptcha_site_key?: string;
|
|
406
|
+
redirectUrl?: string;
|
|
407
|
+
returnToAfterEmailConfirmation?: string;
|
|
408
|
+
showLabels?: boolean;
|
|
409
|
+
signupFields?: (string | Field)[];
|
|
410
|
+
userAgreement?: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
interface SignupWithPasswordViewProps extends PasswordSignupFormProps {
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
interface SignupWithWebAuthnViewProps {
|
|
417
|
+
/**
|
|
418
|
+
* List of authentication options
|
|
419
|
+
*/
|
|
420
|
+
auth?: AuthOptions;
|
|
421
|
+
/** */
|
|
422
|
+
beforeSignup?: <T>(param: T) => T;
|
|
423
|
+
/**
|
|
424
|
+
* The URL sent in the email to which the user is redirected.
|
|
425
|
+
* This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings.
|
|
426
|
+
*/
|
|
427
|
+
redirectUrl?: string;
|
|
428
|
+
/**
|
|
429
|
+
* Returned in the `redirectUrl` as a query parameter, this parameter is used as the post-email confirmation URL.
|
|
430
|
+
* Important: This parameter should only be used with Hosted Pages.
|
|
431
|
+
*/
|
|
432
|
+
returnToAfterEmailConfirmation?: string;
|
|
433
|
+
/**
|
|
434
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
435
|
+
*
|
|
436
|
+
* @default false
|
|
437
|
+
*/
|
|
438
|
+
showLabels?: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* List of the signup fields to display in the form.
|
|
441
|
+
*
|
|
442
|
+
* You can pass a field as an object to override default values :
|
|
443
|
+
*
|
|
444
|
+
* @example
|
|
445
|
+
* {
|
|
446
|
+
* "key": "family_name",
|
|
447
|
+
* "defaultValue": "Moreau",
|
|
448
|
+
* "required": true
|
|
449
|
+
* }
|
|
450
|
+
*/
|
|
451
|
+
signupFields?: (string | Field)[];
|
|
452
|
+
/** */
|
|
453
|
+
userAgreement?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface SignupViewProps extends SignupWithPasswordViewProps, SignupWithWebAuthnViewProps {
|
|
457
|
+
/**
|
|
458
|
+
* Boolean that specifies whether login is enabled.
|
|
459
|
+
*
|
|
460
|
+
* @default true
|
|
461
|
+
*/
|
|
462
|
+
allowLogin?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Boolean that specifies whether biometric login is enabled.
|
|
465
|
+
*
|
|
466
|
+
* @default false
|
|
467
|
+
*/
|
|
468
|
+
allowWebAuthnLogin?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Boolean that specifies whether biometric signup is enabled.
|
|
471
|
+
*
|
|
472
|
+
* @default false
|
|
473
|
+
*/
|
|
474
|
+
allowWebAuthnSignup?: boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Lists the available social providers. This is an array of strings.
|
|
477
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
478
|
+
*/
|
|
479
|
+
socialProviders?: string[];
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface ForgotPasswordViewProps {
|
|
483
|
+
/**
|
|
484
|
+
* Boolean that specifies whether login is enabled.
|
|
485
|
+
*
|
|
486
|
+
* @default true
|
|
487
|
+
*/
|
|
488
|
+
allowLogin?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Whether or not to display a safe error message on password reset, given an invalid email address.
|
|
491
|
+
* This mode ensures not to leak email addresses registered to the platform.
|
|
492
|
+
*
|
|
493
|
+
* @default false
|
|
494
|
+
*/
|
|
495
|
+
displaySafeErrorMessage?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
498
|
+
*
|
|
499
|
+
* @default false
|
|
500
|
+
*/
|
|
501
|
+
showLabels?: boolean;
|
|
502
|
+
/**
|
|
503
|
+
* Boolean that specifies whether biometric login is enabled.
|
|
504
|
+
*
|
|
505
|
+
* @default false
|
|
506
|
+
*/
|
|
507
|
+
allowWebAuthnLogin?: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Boolean that specifies whether reCAPTCHA is enabled or not.
|
|
510
|
+
*/
|
|
511
|
+
recaptcha_enabled?: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup.
|
|
514
|
+
* This must be paired with the appropriate secret key that you received when setting up reCAPTCHA.
|
|
515
|
+
*/
|
|
516
|
+
recaptcha_site_key?: string;
|
|
517
|
+
/**
|
|
518
|
+
* The URL sent in the email to which the user is redirected.
|
|
519
|
+
* This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings.
|
|
520
|
+
*/
|
|
521
|
+
redirectUrl?: string;
|
|
522
|
+
/**
|
|
523
|
+
* Returned in the `redirectUrl` as a query parameter, this parameter is used to redirect users to a specific URL after a password reset.
|
|
524
|
+
* Important: This parameter should only be used with Hosted Pages.
|
|
525
|
+
*/
|
|
526
|
+
returnToAfterPasswordReset?: string;
|
|
527
|
+
}
|
|
528
|
+
interface ForgotPasswordSuccessViewProps {
|
|
529
|
+
allowLogin?: boolean;
|
|
530
|
+
allowWebAuthnLogin?: boolean;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
interface QuickLoginViewProps {
|
|
534
|
+
/**
|
|
535
|
+
* Boolean that specifies whether biometric login is enabled.
|
|
536
|
+
*
|
|
537
|
+
* @default false
|
|
538
|
+
*/
|
|
539
|
+
allowWebAuthnLogin?: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* List of authentication options
|
|
542
|
+
*/
|
|
543
|
+
auth?: AuthOptions;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
interface ReauthViewProps {
|
|
547
|
+
/**
|
|
548
|
+
* Boolean that specifies if the forgot password option is enabled.
|
|
549
|
+
*
|
|
550
|
+
* If the `allowLogin` and `allowSignup` properties are set to `false`, the forgot password feature is enabled even if `allowForgotPassword` is set to `false`.
|
|
551
|
+
*
|
|
552
|
+
* @default true
|
|
553
|
+
*/
|
|
554
|
+
allowForgotPassword?: boolean;
|
|
555
|
+
/**
|
|
556
|
+
* List of authentication options
|
|
557
|
+
*/
|
|
558
|
+
auth?: AuthOptions;
|
|
559
|
+
/**
|
|
560
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
561
|
+
*
|
|
562
|
+
* @default false
|
|
563
|
+
*/
|
|
564
|
+
showLabels?: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Lists the available social providers. This is an array of strings.
|
|
567
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
568
|
+
*/
|
|
569
|
+
socialProviders?: string[];
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
interface StartPasswordlessFormData {
|
|
573
|
+
authType: PasswordlessParams['authType'];
|
|
574
|
+
}
|
|
575
|
+
interface MainViewProps$5 {
|
|
576
|
+
/**
|
|
577
|
+
* **Not recommended**
|
|
578
|
+
*
|
|
579
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
580
|
+
*
|
|
581
|
+
* If empty, using an existing SSO session cookie.
|
|
582
|
+
*/
|
|
583
|
+
accessToken?: string;
|
|
584
|
+
/**
|
|
585
|
+
* List of authentication options
|
|
586
|
+
*/
|
|
587
|
+
auth?: AuthOptions;
|
|
588
|
+
/**
|
|
589
|
+
* Show the introduction text.
|
|
590
|
+
*
|
|
591
|
+
* @default true
|
|
592
|
+
*/
|
|
593
|
+
showIntro?: boolean;
|
|
594
|
+
/**
|
|
595
|
+
* Show the stepup button. Unnecessary for console use
|
|
596
|
+
*
|
|
597
|
+
* @default true
|
|
598
|
+
*/
|
|
599
|
+
showStepUpStart?: boolean;
|
|
600
|
+
}
|
|
601
|
+
type FaSelectionViewState = MFA.StepUpResponse;
|
|
602
|
+
type FaSelectionViewProps = Prettify<Partial<MFA.StepUpResponse> & {
|
|
603
|
+
showIntro?: boolean;
|
|
604
|
+
}>;
|
|
605
|
+
type StepUpResponse = RequiredProperty<PasswordlessResponse, 'challengeId'>;
|
|
606
|
+
type StepUpHandlerResponse = StepUpResponse & StartPasswordlessFormData;
|
|
607
|
+
type VerificationCodeViewState = Prettify<StepUpHandlerResponse>;
|
|
608
|
+
type VerificationCodeViewProps$3 = Prettify<Partial<StepUpHandlerResponse> & {
|
|
609
|
+
/**
|
|
610
|
+
* List of authentication options
|
|
611
|
+
*/
|
|
612
|
+
auth?: AuthOptions;
|
|
613
|
+
}>;
|
|
614
|
+
type MfaStepUpProps = MainViewProps$5 & FaSelectionViewProps & VerificationCodeViewProps$3;
|
|
615
|
+
type MfaStepUpWidgetProps = MfaStepUpProps;
|
|
616
|
+
|
|
617
|
+
interface AuthWidgetProps extends LoginViewProps, LoginWithWebAuthnViewProps, LoginWithPasswordViewProps, SignupViewProps, SignupWithPasswordViewProps, SignupWithWebAuthnViewProps, ForgotPasswordViewProps, ForgotPasswordSuccessViewProps, QuickLoginViewProps, ReauthViewProps, Omit<FaSelectionViewProps, keyof FaSelectionViewState>, Omit<VerificationCodeViewProps$3, keyof VerificationCodeViewState> {
|
|
618
|
+
/**
|
|
619
|
+
* Boolean that specifies whether quick login is enabled.
|
|
620
|
+
*
|
|
621
|
+
* @default true
|
|
622
|
+
*/
|
|
623
|
+
allowQuickLogin?: boolean;
|
|
624
|
+
/**
|
|
625
|
+
* The widget’s initial screen.
|
|
626
|
+
*
|
|
627
|
+
* - if `allowLogin` is set to `true`, it defaults to `login`.
|
|
628
|
+
* - if `allowLogin` is set to `false` and `allowSignup` is set to `true`, it defaults to `signup`.
|
|
629
|
+
* - if `allowLogin` is set to `false` and `allowWebAuthnLogin` is set to `true`, it defaults to `login-with-web-authn`.
|
|
630
|
+
* - otherwise, defaults to `forgot-password`.
|
|
631
|
+
*/
|
|
632
|
+
initialScreen?: 'login' | 'login-with-web-authn' | 'signup' | 'forgot-password';
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
interface MainViewProps$4 {
|
|
636
|
+
/**
|
|
637
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
638
|
+
*/
|
|
639
|
+
accessToken: string;
|
|
640
|
+
/**
|
|
641
|
+
* Boolean that specifies whether reCAPTCHA is enabled or not.
|
|
642
|
+
*/
|
|
643
|
+
recaptcha_enabled?: boolean;
|
|
644
|
+
/**
|
|
645
|
+
* The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup.
|
|
646
|
+
* This must be paired with the appropriate secret key that you received when setting up reCAPTCHA.
|
|
647
|
+
*/
|
|
648
|
+
recaptcha_site_key?: string;
|
|
649
|
+
/**
|
|
650
|
+
* The URL sent in the email to which the user is redirected.
|
|
651
|
+
* This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings.
|
|
652
|
+
*/
|
|
653
|
+
redirectUrl?: string;
|
|
654
|
+
/**
|
|
655
|
+
* Whether the signup form fields' labels are displayed on the login view.
|
|
656
|
+
* @default false
|
|
657
|
+
*/
|
|
658
|
+
showLabels?: boolean;
|
|
659
|
+
}
|
|
660
|
+
interface EmailEditorWidgetProps extends MainViewProps$4 {
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
interface PasswordEditorFormProps {
|
|
664
|
+
/**
|
|
665
|
+
* Ask for the old password before entering a new one.
|
|
666
|
+
* @default false
|
|
667
|
+
*/
|
|
668
|
+
promptOldPassword?: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* Whether or not to provide the display password in clear text option.
|
|
671
|
+
* @default false
|
|
672
|
+
*/
|
|
673
|
+
canShowPassword?: boolean;
|
|
674
|
+
}
|
|
675
|
+
interface PasswordEditorProps extends PasswordEditorFormProps {
|
|
676
|
+
/**
|
|
677
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
678
|
+
*/
|
|
679
|
+
accessToken?: string;
|
|
680
|
+
/**
|
|
681
|
+
* @toto missing description
|
|
682
|
+
*/
|
|
683
|
+
authentication?: Authentication;
|
|
684
|
+
/**
|
|
685
|
+
* @toto missing description
|
|
686
|
+
*/
|
|
687
|
+
userId?: string;
|
|
688
|
+
/**
|
|
689
|
+
* Whether the form fields' labels are displayed on the form view.
|
|
690
|
+
* @default false
|
|
691
|
+
*/
|
|
692
|
+
showLabels?: boolean;
|
|
693
|
+
/**
|
|
694
|
+
* Callback function called when the request has failed.
|
|
695
|
+
*/
|
|
696
|
+
onSuccess?: () => void;
|
|
697
|
+
/**
|
|
698
|
+
* Callback function called after the widget has been successfully loaded and rendered inside the container.
|
|
699
|
+
* The callback is called with the widget instance.
|
|
700
|
+
*/
|
|
701
|
+
onError?: () => void;
|
|
702
|
+
}
|
|
703
|
+
type Authentication = {
|
|
704
|
+
accessToken: string;
|
|
705
|
+
} | {
|
|
706
|
+
userId: string;
|
|
707
|
+
};
|
|
708
|
+
type PasswordEditorWidgetProps = Omit<PasswordEditorProps, 'authentication'>;
|
|
709
|
+
|
|
710
|
+
interface MainViewProps$3 {
|
|
711
|
+
/**
|
|
712
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
713
|
+
*/
|
|
714
|
+
accessToken: string;
|
|
715
|
+
/**
|
|
716
|
+
* Whether the form fields's labels are displayed on the login view.
|
|
717
|
+
*
|
|
718
|
+
* @default false
|
|
719
|
+
*/
|
|
720
|
+
showLabels?: boolean;
|
|
721
|
+
}
|
|
722
|
+
type VerificationCodeViewProps$2 = {
|
|
723
|
+
/**
|
|
724
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
725
|
+
*/
|
|
726
|
+
accessToken: string;
|
|
727
|
+
/**
|
|
728
|
+
* Callback function called when the request has failed.
|
|
729
|
+
*/
|
|
730
|
+
onSuccess?: () => void;
|
|
731
|
+
/**
|
|
732
|
+
* Callback function called after the widget has been successfully loaded and rendered inside the container.
|
|
733
|
+
* The callback is called with the widget instance.
|
|
734
|
+
*/
|
|
735
|
+
onError?: () => void;
|
|
736
|
+
};
|
|
737
|
+
type PhoneNumberEditorWidgetProps = Prettify<MainViewProps$3 & VerificationCodeViewProps$2>;
|
|
738
|
+
|
|
739
|
+
interface MainViewProps$2 {
|
|
740
|
+
/**
|
|
741
|
+
* Whether or not to provide the display password in clear text option.
|
|
742
|
+
* @default false
|
|
743
|
+
*/
|
|
744
|
+
canShowPassword?: boolean;
|
|
745
|
+
/**
|
|
746
|
+
* Callback function called when the request has failed.
|
|
747
|
+
*/
|
|
748
|
+
onSuccess?: () => void;
|
|
749
|
+
/**
|
|
750
|
+
* Callback function called after the widget has been successfully loaded and rendered inside the container.
|
|
751
|
+
* The callback is called with the widget instance.
|
|
752
|
+
*/
|
|
753
|
+
onError?: () => void;
|
|
754
|
+
/**
|
|
755
|
+
* Whether the form fields' labels are displayed on the form view.
|
|
756
|
+
* @default false
|
|
757
|
+
*/
|
|
758
|
+
showLabels?: boolean;
|
|
759
|
+
}
|
|
760
|
+
interface SuccessViewProps {
|
|
761
|
+
loginLink?: string;
|
|
762
|
+
}
|
|
763
|
+
interface PasswordResetWidgetProps extends MainViewProps$2, SuccessViewProps {
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
interface MainViewProps$1 {
|
|
767
|
+
/**
|
|
768
|
+
* List of authentication options
|
|
769
|
+
*/
|
|
770
|
+
auth?: AuthOptions;
|
|
771
|
+
/**
|
|
772
|
+
* The passwordless auth type (`magic_link` or `sms`).
|
|
773
|
+
* @default "magic_link"
|
|
774
|
+
*/
|
|
775
|
+
authType?: SingleFactorPasswordlessParams['authType'];
|
|
776
|
+
/**
|
|
777
|
+
* Boolean that specifies whether reCAPTCHA is enabled or not.
|
|
778
|
+
*/
|
|
779
|
+
recaptcha_enabled?: boolean;
|
|
780
|
+
/**
|
|
781
|
+
* The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup.
|
|
782
|
+
* This must be paired with the appropriate secret key that you received when setting up reCAPTCHA.
|
|
783
|
+
*/
|
|
784
|
+
recaptcha_site_key?: string;
|
|
785
|
+
/**
|
|
786
|
+
* Show the introduction text.
|
|
787
|
+
* @default true
|
|
788
|
+
*/
|
|
789
|
+
showIntro?: boolean;
|
|
790
|
+
/**
|
|
791
|
+
* Show the social login buttons.
|
|
792
|
+
* @default false
|
|
793
|
+
*/
|
|
794
|
+
showSocialLogins?: boolean;
|
|
795
|
+
/**
|
|
796
|
+
* Lists the available social providers. This is an array of strings.
|
|
797
|
+
*
|
|
798
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
799
|
+
*/
|
|
800
|
+
socialProviders?: string[];
|
|
801
|
+
}
|
|
802
|
+
interface VerificationCodeViewProps$1 {
|
|
803
|
+
/**
|
|
804
|
+
* The passwordless auth type (`magic_link` or `sms`).
|
|
805
|
+
* @default "magic_link"
|
|
806
|
+
*/
|
|
807
|
+
authType?: SingleFactorPasswordlessParams['authType'];
|
|
808
|
+
/**
|
|
809
|
+
* Boolean that specifies whether reCAPTCHA is enabled or not.
|
|
810
|
+
*/
|
|
811
|
+
recaptcha_enabled?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup.
|
|
814
|
+
* This must be paired with the appropriate secret key that you received when setting up reCAPTCHA.
|
|
815
|
+
*/
|
|
816
|
+
recaptcha_site_key?: string;
|
|
817
|
+
}
|
|
818
|
+
type PasswordlessWidgetProps = Prettify<MainViewProps$1 & VerificationCodeViewProps$1>;
|
|
819
|
+
|
|
820
|
+
type ProfileWithConsents = Profile & {
|
|
821
|
+
consents?: Record<string, UserConsent>;
|
|
822
|
+
};
|
|
823
|
+
interface ProfileEditorProps {
|
|
824
|
+
/**
|
|
825
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
826
|
+
*/
|
|
827
|
+
accessToken: string;
|
|
828
|
+
/**
|
|
829
|
+
* Callback function called when the request has failed.
|
|
830
|
+
*/
|
|
831
|
+
onSuccess?: () => void;
|
|
832
|
+
/**
|
|
833
|
+
* Callback function called after the widget has been successfully loaded and rendered inside the container.
|
|
834
|
+
* The callback is called with the widget instance.
|
|
835
|
+
*/
|
|
836
|
+
onError?: () => void;
|
|
837
|
+
/**
|
|
838
|
+
*
|
|
839
|
+
*/
|
|
840
|
+
profile: ProfileWithConsents;
|
|
841
|
+
/**
|
|
842
|
+
* The URL sent in the email to which the user is redirected.
|
|
843
|
+
* This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings.
|
|
844
|
+
*/
|
|
845
|
+
redirectUrl?: string;
|
|
846
|
+
/**
|
|
847
|
+
*
|
|
848
|
+
*/
|
|
849
|
+
resolvedFields: FieldCreator<unknown>[];
|
|
850
|
+
/**
|
|
851
|
+
* Whether the form fields' labels are displayed on the form view.
|
|
852
|
+
* @default false
|
|
853
|
+
*/
|
|
854
|
+
showLabels?: boolean;
|
|
855
|
+
}
|
|
856
|
+
interface ProfileEditorWidgetProps extends Omit<ProfileEditorProps, 'profile' | 'resolvedFields'> {
|
|
857
|
+
/**
|
|
858
|
+
* List of the fields to display in the form.
|
|
859
|
+
*
|
|
860
|
+
* **Important:**
|
|
861
|
+
*
|
|
862
|
+
* The following fields can not be changed with this widget:
|
|
863
|
+
* - `password`
|
|
864
|
+
* - `password_confirmation`
|
|
865
|
+
*
|
|
866
|
+
* It is not possible to update the primary identifier submitted at registration (email or phone number). When the primary identifier is the email address (SMS feature disabled), users can only enter a phone number and update without limit.
|
|
867
|
+
*/
|
|
868
|
+
fields?: (string | Field)[];
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
interface SocialAccountsWidgetProps {
|
|
872
|
+
/**
|
|
873
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
874
|
+
*/
|
|
875
|
+
accessToken: string;
|
|
876
|
+
/**
|
|
877
|
+
* List of authentication options
|
|
878
|
+
*/
|
|
879
|
+
auth?: AuthOptions;
|
|
880
|
+
/**
|
|
881
|
+
* Lists the available social providers. This is an array of strings.
|
|
882
|
+
*
|
|
883
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
884
|
+
* */
|
|
885
|
+
providers?: string[];
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
interface SocialLoginWidgetProps {
|
|
889
|
+
/**
|
|
890
|
+
* @deprecated
|
|
891
|
+
*/
|
|
892
|
+
acceptTos?: boolean;
|
|
893
|
+
/**
|
|
894
|
+
* List of authentication options
|
|
895
|
+
*/
|
|
896
|
+
auth?: AuthOptions;
|
|
897
|
+
/**
|
|
898
|
+
* Lists the available social providers. This is an array of strings.
|
|
899
|
+
*
|
|
900
|
+
* Tip: If you pass an empty array, social providers will not be displayed.
|
|
901
|
+
* */
|
|
902
|
+
socialProviders?: string[];
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
interface WebAuthnDevicesProps {
|
|
906
|
+
/**
|
|
907
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
908
|
+
*/
|
|
909
|
+
accessToken: string;
|
|
910
|
+
/**
|
|
911
|
+
* Registred FIDO2 devices
|
|
912
|
+
*/
|
|
913
|
+
devices: DeviceCredential[];
|
|
914
|
+
/**
|
|
915
|
+
* Whether the form fields's labels are displayed on the login view.
|
|
916
|
+
*
|
|
917
|
+
* @default false
|
|
918
|
+
*/
|
|
919
|
+
showLabels?: boolean;
|
|
920
|
+
}
|
|
921
|
+
type WebAuthnWidgetProps = Omit<WebAuthnDevicesProps, 'devices'>;
|
|
922
|
+
|
|
923
|
+
interface MainViewProps {
|
|
924
|
+
/**
|
|
925
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
926
|
+
*/
|
|
927
|
+
accessToken: string;
|
|
928
|
+
/**
|
|
929
|
+
* The user’s MFA credentials
|
|
930
|
+
*/
|
|
931
|
+
credentials: MFA.CredentialsResponse['credentials'];
|
|
932
|
+
/**
|
|
933
|
+
* Boolean to enable (`true`) or disable (`false`) whether the option to remove MFA credentials are displayed.
|
|
934
|
+
*
|
|
935
|
+
* @default false
|
|
936
|
+
*/
|
|
937
|
+
requireMfaRegistration?: boolean;
|
|
938
|
+
/**
|
|
939
|
+
* Show the introduction text.
|
|
940
|
+
*
|
|
941
|
+
* @default true
|
|
942
|
+
*/
|
|
943
|
+
showIntro?: boolean;
|
|
944
|
+
/**
|
|
945
|
+
* Boolean to enable (true) or disable (false) whether the option to remove MFA credentials are displayed.
|
|
946
|
+
*
|
|
947
|
+
* @default true
|
|
948
|
+
*/
|
|
949
|
+
showRemoveMfaCredentials?: boolean;
|
|
950
|
+
}
|
|
951
|
+
interface VerificationCodeViewProps {
|
|
952
|
+
/**
|
|
953
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
954
|
+
*/
|
|
955
|
+
accessToken: string;
|
|
956
|
+
/**
|
|
957
|
+
* Show the introduction text.
|
|
958
|
+
*/
|
|
959
|
+
showIntro?: boolean;
|
|
960
|
+
}
|
|
961
|
+
interface CredentialRegisteredViewProps {
|
|
962
|
+
}
|
|
963
|
+
type CredentialRemovedViewProps = {};
|
|
964
|
+
type MfaCredentialsProps = Prettify<MainViewProps & CredentialRegisteredViewProps & VerificationCodeViewProps & CredentialRemovedViewProps>;
|
|
965
|
+
type MfaCredentialsWidgetProps = Prettify<Omit<MfaCredentialsProps, 'credentials'>>;
|
|
966
|
+
|
|
967
|
+
type MfaListWidgetProps = {
|
|
968
|
+
/**
|
|
969
|
+
* The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.
|
|
970
|
+
*/
|
|
971
|
+
accessToken: string;
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
interface WidgetInstance {
|
|
975
|
+
destroy(): void;
|
|
976
|
+
}
|
|
977
|
+
interface WidgetProps {
|
|
978
|
+
/** The DOM element or the `id` of a DOM element in which the widget should be embedded. */
|
|
979
|
+
container: string | HTMLElement;
|
|
980
|
+
/**
|
|
981
|
+
* The [ISO country](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code useful to format phone numbers.
|
|
982
|
+
* Defaults to the predefined country code in your account settings or `FR`.
|
|
983
|
+
*/
|
|
984
|
+
countryCode?: string;
|
|
985
|
+
/**
|
|
986
|
+
* Callback function called after the widget has been successfully loaded and rendered inside the container.
|
|
987
|
+
* The callback is called with the widget instance.
|
|
988
|
+
*/
|
|
989
|
+
onReady?: (instance: WidgetInstance) => void;
|
|
990
|
+
}
|
|
991
|
+
type WidgetOptions<P> = Prettify<P & WidgetProps & I18nProps$1 & ThemeProps>;
|
|
992
|
+
type Widget<P> = (props: P, ctx: Context) => Promise<React$1.JSX.Element>;
|
|
993
|
+
declare class UiClient {
|
|
994
|
+
config: Config;
|
|
995
|
+
core: Client$1;
|
|
996
|
+
defaultI18n: I18nMessages;
|
|
997
|
+
constructor(config: Config, coreClient: Client$1, defaultI18n: I18nMessages);
|
|
998
|
+
showAuth(options: WidgetOptions<AuthWidgetProps>): void;
|
|
999
|
+
showSocialLogin(options: WidgetOptions<SocialLoginWidgetProps>): void;
|
|
1000
|
+
showPasswordless(options: WidgetOptions<PasswordlessWidgetProps>): void;
|
|
1001
|
+
showEmailEditor(options: WidgetOptions<EmailEditorWidgetProps>): void;
|
|
1002
|
+
showPasswordEditor(options: WidgetOptions<PasswordEditorWidgetProps>): void;
|
|
1003
|
+
showPhoneNumberEditor(options: WidgetOptions<PhoneNumberEditorWidgetProps>): void;
|
|
1004
|
+
showProfileEditor(options: WidgetOptions<ProfileEditorWidgetProps>): void;
|
|
1005
|
+
showPasswordReset(options: WidgetOptions<PasswordResetWidgetProps>): void;
|
|
1006
|
+
showSocialAccounts(options: WidgetOptions<SocialAccountsWidgetProps>): void;
|
|
1007
|
+
showWebAuthnDevices(options: WidgetOptions<WebAuthnWidgetProps>): void;
|
|
1008
|
+
showMfa(options: WidgetOptions<MfaCredentialsWidgetProps>): void;
|
|
1009
|
+
showStepUp(options: WidgetOptions<MfaStepUpWidgetProps>): void;
|
|
1010
|
+
showMfaCredentials(options: WidgetOptions<MfaListWidgetProps>): void;
|
|
1011
|
+
_showWidget<P extends WidgetProps>(widget: Widget<Omit<P, keyof WidgetProps>>, options?: P, props?: {}): Promise<void>;
|
|
1012
|
+
_ssoCheck<P extends WidgetProps>(widget: Widget<Omit<P, keyof WidgetProps>>, options: P & {
|
|
1013
|
+
auth?: AuthOptions;
|
|
1014
|
+
}): void;
|
|
1015
|
+
adaptError(error: unknown): string | boolean;
|
|
1016
|
+
handleError(error: unknown): void;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
type Client = {
|
|
1020
|
+
core: Client$1;
|
|
1021
|
+
showAuth: InstanceType<typeof UiClient>['showAuth'];
|
|
1022
|
+
showEmailEditor: InstanceType<typeof UiClient>['showEmailEditor'];
|
|
1023
|
+
showPasswordEditor: InstanceType<typeof UiClient>['showPasswordEditor'];
|
|
1024
|
+
showPhoneNumberEditor: InstanceType<typeof UiClient>['showPhoneNumberEditor'];
|
|
1025
|
+
showPasswordReset: InstanceType<typeof UiClient>['showPasswordReset'];
|
|
1026
|
+
showPasswordless: InstanceType<typeof UiClient>['showPasswordless'];
|
|
1027
|
+
showProfileEditor: InstanceType<typeof UiClient>['showProfileEditor'];
|
|
1028
|
+
showSocialAccounts: InstanceType<typeof UiClient>['showSocialAccounts'];
|
|
1029
|
+
showSocialLogin: InstanceType<typeof UiClient>['showSocialLogin'];
|
|
1030
|
+
showWebAuthnDevices: InstanceType<typeof UiClient>['showWebAuthnDevices'];
|
|
1031
|
+
showMfa: InstanceType<typeof UiClient>['showMfa'];
|
|
1032
|
+
showMfaCredentials: InstanceType<typeof UiClient>['showMfaCredentials'];
|
|
1033
|
+
showStepUp: InstanceType<typeof UiClient>['showStepUp'];
|
|
1034
|
+
};
|
|
1035
|
+
declare function createClient(creationConfig: Config$1): Client;
|
|
1036
|
+
|
|
1037
|
+
export { type Client, type ThemeOptions, createClient };
|