@genesislcap/foundation-auth 14.180.6 → 14.180.8
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/dist/dts/config/config.d.ts +27 -0
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/routes/base.d.ts +11 -12
- package/dist/dts/routes/base.d.ts.map +1 -1
- package/dist/dts/routes/login/login.d.ts.map +1 -1
- package/dist/dts/routes/request-account/request-account.template.d.ts.map +1 -1
- package/dist/dts/routes/reset-password/reset-password.template.d.ts.map +1 -1
- package/dist/esm/config/config.js +2 -0
- package/dist/esm/machine/machine.js +14 -14
- package/dist/esm/routes/base.js +25 -11
- package/dist/esm/routes/forgot-password/forgot-password.template.js +3 -3
- package/dist/esm/routes/login/login.js +3 -1
- package/dist/esm/routes/login/login.template.js +7 -7
- package/dist/esm/routes/not-found/not-found.js +1 -1
- package/dist/esm/routes/protected/protected.template.js +4 -4
- package/dist/esm/routes/request-account/request-account.template.js +2 -5
- package/dist/esm/routes/reset-password/reset-password.template.js +4 -3
- package/dist/esm/routes/verify/verify.template.js +4 -4
- package/dist/esm/translation.json +56 -0
- package/dist/foundation-auth.api.json +32 -0
- package/dist/foundation-auth.d.ts +27 -0
- package/docs/api/foundation-auth.authconfig.localizationresources.md +36 -0
- package/docs/api/foundation-auth.authconfig.md +1 -0
- package/docs/api-report.md +2 -0
- package/package.json +20 -18
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { I18nextConfig } from '@genesislcap/foundation-i18n';
|
|
1
2
|
import { ComposableStyles, PartialFASTElementDefinition } from '@microsoft/fast-element';
|
|
2
3
|
import type { AuthRoutes } from '../routes/types';
|
|
3
4
|
import { TemplateOptions } from './templates';
|
|
@@ -186,6 +187,32 @@ export interface AuthConfig extends PartialFASTElementDefinition {
|
|
|
186
187
|
* The amount of seconds to display user feedback messages, such as "check your inbox" etc. Defaults to 3 seconds.
|
|
187
188
|
*/
|
|
188
189
|
feedbackDelay?: number;
|
|
190
|
+
/**
|
|
191
|
+
* I18n resources.
|
|
192
|
+
*
|
|
193
|
+
* @remarks
|
|
194
|
+
* This property holds the localization resources needed for internationalization of the application.
|
|
195
|
+
* It should follow the structure defined by the I18nextConfig interface, which includes
|
|
196
|
+
* translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each
|
|
197
|
+
* namespace includes key-value pairs for translation strings.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* resources: {
|
|
202
|
+
* en: {
|
|
203
|
+
* 'foundation-auth': {
|
|
204
|
+
* key: 'Hello World'
|
|
205
|
+
* }
|
|
206
|
+
* },
|
|
207
|
+
* es: {
|
|
208
|
+
* 'foundation-auth': {
|
|
209
|
+
* key: 'Hola Mundo'
|
|
210
|
+
* }
|
|
211
|
+
* }
|
|
212
|
+
* }
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
localizationResources?: I18nextConfig['resources'];
|
|
189
216
|
}
|
|
190
217
|
/**
|
|
191
218
|
* Default AuthConfig DI implementation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAO,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAK9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAA0B,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,4BAA4B;IAC9D;;;;;OAKG;IACH,eAAe,EAAE,eAAe,CAAC;IACjC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACnD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACzD;;;;;OAKG;IACH,eAAe,EAAE;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;KAChD,GAAG,IAAI,CAAC;IACT;;;;;;;;;;OAUG;IACH,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,GAAG,WAAW,CAAC,EAAE,CAAC;IACzD;;;;;OAKG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,qBAAqB,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACpD;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAyC/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,kEAAuE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { I18next } from '@genesislcap/foundation-i18n';
|
|
1
2
|
import { User } from '@genesislcap/foundation-user';
|
|
2
3
|
import { Binding } from '@microsoft/fast-element';
|
|
3
4
|
import { Container } from '@microsoft/fast-foundation';
|
|
@@ -44,12 +45,8 @@ declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
|
44
45
|
translate: boolean;
|
|
45
46
|
attachInternals(): ElementInternals;
|
|
46
47
|
click(): void;
|
|
47
|
-
addEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
48
|
-
|
|
49
|
-
*/
|
|
50
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; /**
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
48
|
+
addEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
49
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
53
50
|
removeEventListener<K_2 extends keyof HTMLElementEventMap>(type: K_2, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_2]) => any, options?: boolean | EventListenerOptions): void;
|
|
54
51
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
55
52
|
readonly attributes: NamedNodeMap;
|
|
@@ -152,11 +149,7 @@ declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
|
152
149
|
readonly ATTRIBUTE_NODE: number;
|
|
153
150
|
readonly CDATA_SECTION_NODE: number;
|
|
154
151
|
readonly COMMENT_NODE: number;
|
|
155
|
-
readonly DOCUMENT_FRAGMENT_NODE: number;
|
|
156
|
-
* @internal
|
|
157
|
-
* @privateRemarks
|
|
158
|
-
* Temp optimisation. How we handle images like this needs a broader review.
|
|
159
|
-
*/
|
|
152
|
+
readonly DOCUMENT_FRAGMENT_NODE: number;
|
|
160
153
|
readonly DOCUMENT_NODE: number;
|
|
161
154
|
readonly DOCUMENT_POSITION_CONTAINED_BY: number;
|
|
162
155
|
readonly DOCUMENT_POSITION_CONTAINS: number;
|
|
@@ -354,6 +347,11 @@ declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
|
354
347
|
export declare class ConfigHostElement extends ConfigHostElement_base implements ConfigHost {
|
|
355
348
|
container: Container;
|
|
356
349
|
config: AuthConfig;
|
|
350
|
+
/**
|
|
351
|
+
* i18next instance for managing internationalization.
|
|
352
|
+
* @internal
|
|
353
|
+
*/
|
|
354
|
+
i18next: I18next;
|
|
357
355
|
connectedCallback(): void;
|
|
358
356
|
}
|
|
359
357
|
/**
|
|
@@ -364,6 +362,7 @@ export declare class BaseRoute extends ConfigHostElement {
|
|
|
364
362
|
store: AuthStore;
|
|
365
363
|
routing: AuthRouting;
|
|
366
364
|
onBack: () => void;
|
|
365
|
+
toLocalisedText(text: string): string;
|
|
367
366
|
}
|
|
368
367
|
/**
|
|
369
368
|
* @internal
|
|
@@ -388,7 +387,7 @@ export declare const password2Field: <T extends BaseRoute>(type: 'new' | 'confir
|
|
|
388
387
|
/**
|
|
389
388
|
* @internal
|
|
390
389
|
*/
|
|
391
|
-
export declare const backButton: <T extends ConfigHost>(binding: Binding) => import("@microsoft/fast-element").ViewTemplate<T, any>;
|
|
390
|
+
export declare const backButton: <T extends ConfigHost>(binding: Binding, label: string) => import("@microsoft/fast-element").ViewTemplate<T, any>;
|
|
392
391
|
/**
|
|
393
392
|
* @internal
|
|
394
393
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGpD,OAAO,EAEL,OAAO,EAQR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGpD,OAAO,EAEL,OAAO,EAQR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,KAAK,QAAQ,GAAG,YAAY,GAAG,qBAAqB,GAAG,EAAE,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,SAAS,wLAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,UAAU,wLAAkC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,sBAAoC,YAAW,UAAU;IACnF,SAAS,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACM,OAAO,EAAG,OAAO,CAAC;IAE3B,iBAAiB;CAalB;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,iBAAiB;IACxC,IAAI,EAAE,IAAI,CAAC;IACN,KAAK,EAAE,SAAS,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;IAElC,MAAM,aAAsC;IAE5C,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGtC;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,mFAsB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,mFAiBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,mFAkBtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,gCAAiC,MAAM,2DAahE,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,cAAc,8BAA+B,KAAK,GAAG,cAAc,2DAgB/E,CAAC;AA0GF;;GAEG;AACH,eAAO,MAAM,UAAU,kCAAmC,OAAO,SAAS,MAAM,2DAU/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,gCAChB,MAAM,eACD,MAAM,aACR,OAAO,2DAWlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,mFASjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/routes/login/login.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;;;;;;;;GAaG;AACH,qBAKa,KAAM,SAAQ,SAAS;IACf,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,iBAAiB;IAYjB,OAAO,CAAC,iBAAiB;IAezB,IACI,cAAc,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/routes/login/login.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;;;;;;;;GAaG;AACH,qBAKa,KAAM,SAAQ,SAAS;IACf,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,iBAAiB;IAYjB,OAAO,CAAC,iBAAiB;IAezB,IACI,cAAc,WAMjB;IAED,UAAU;IAmBJ,aAAa;IAInB,KAAK,CAAC,MAAM,EAAE,WAAW;IAIzB,MAAM;IAIN,IAAI,cAAc,YAEjB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-account.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/request-account/request-account.template.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"request-account.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/request-account/request-account.template.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,qEA2BlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,oEA4BjC,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { Route } from '@microsoft/fast-router';
|
|
|
5
5
|
import defaultBackgroundSrc from '../assets/bg.jpg';
|
|
6
6
|
import defaultLogoSrc from '../assets/genesis-logo-light.svg';
|
|
7
7
|
import { navigateTo } from '../routes/utils';
|
|
8
|
+
import localizationResources from '../translation.json';
|
|
8
9
|
import { defaultTemplateOptions } from './templates';
|
|
9
10
|
/**
|
|
10
11
|
* Default AuthConfig DI implementation.
|
|
@@ -50,6 +51,7 @@ export const defaultAuthConfig = {
|
|
|
50
51
|
toggled: false,
|
|
51
52
|
},
|
|
52
53
|
feedbackDelay: 3000,
|
|
54
|
+
localizationResources,
|
|
53
55
|
};
|
|
54
56
|
/**
|
|
55
57
|
* AuthConfig DI key.
|
|
@@ -396,7 +396,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
396
396
|
changePassword: {
|
|
397
397
|
tags: ['feedback', 'changePassword'],
|
|
398
398
|
meta: {
|
|
399
|
-
content: '
|
|
399
|
+
content: 'MESSAGE_PASSWORD_CHANGE_SUCCESS',
|
|
400
400
|
},
|
|
401
401
|
after: {
|
|
402
402
|
feedbackDelay: '#authMachine.idle',
|
|
@@ -405,7 +405,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
405
405
|
forgotPassword: {
|
|
406
406
|
tags: ['feedback', 'forgotPassword'],
|
|
407
407
|
meta: {
|
|
408
|
-
content: '
|
|
408
|
+
content: 'MESSAGE_FORGOT_PASSWORD_RESET',
|
|
409
409
|
},
|
|
410
410
|
after: {
|
|
411
411
|
feedbackDelay: '#authMachine.idle',
|
|
@@ -414,7 +414,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
414
414
|
resetPassword: {
|
|
415
415
|
tags: ['feedback', 'resetPassword'],
|
|
416
416
|
meta: {
|
|
417
|
-
content: '
|
|
417
|
+
content: 'MESSAGE_PASSWORD_RESET_SUCCESS',
|
|
418
418
|
},
|
|
419
419
|
after: {
|
|
420
420
|
feedbackDelay: '#authMachine.idle',
|
|
@@ -423,7 +423,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
423
423
|
incorrectCredentials: {
|
|
424
424
|
tags: ['feedback', 'incorrectCredentials'],
|
|
425
425
|
meta: {
|
|
426
|
-
content: '
|
|
426
|
+
content: 'MESSAGE_INCORRECT_CREDENTIALS',
|
|
427
427
|
},
|
|
428
428
|
after: {
|
|
429
429
|
feedbackDelay: '#authMachine.idle',
|
|
@@ -432,7 +432,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
432
432
|
mfaRequired: {
|
|
433
433
|
tags: ['feedback', 'mfaRequired'],
|
|
434
434
|
meta: {
|
|
435
|
-
content: '
|
|
435
|
+
content: 'MESSAGE_MFA_REQUIRED',
|
|
436
436
|
},
|
|
437
437
|
after: {
|
|
438
438
|
feedbackDelay: '#authMachine.idle',
|
|
@@ -441,7 +441,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
441
441
|
passwordExpired: {
|
|
442
442
|
tags: ['feedback', 'passwordExpired'],
|
|
443
443
|
meta: {
|
|
444
|
-
content: '
|
|
444
|
+
content: 'MESSAGE_PASSWORD_EXPIRED',
|
|
445
445
|
},
|
|
446
446
|
after: {
|
|
447
447
|
feedbackDelay: {
|
|
@@ -459,14 +459,14 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
459
459
|
initial: 'unknown',
|
|
460
460
|
entry: ['setError', 'errorCallback'],
|
|
461
461
|
states: {
|
|
462
|
-
unknown: createErrorStateNode('unknown', '
|
|
463
|
-
login: createErrorStateNode('login', '
|
|
464
|
-
silentLogin: createErrorStateNode('silent-login', '
|
|
465
|
-
changePassword: createErrorStateNode('change-password', '
|
|
466
|
-
forgotPassword: createErrorStateNode('forgot-password', '
|
|
467
|
-
resetPassword: createErrorStateNode('reset-password', '
|
|
468
|
-
logout: createErrorStateNode('logout', '
|
|
469
|
-
mapping: createErrorStateNode('mapping', '
|
|
462
|
+
unknown: createErrorStateNode('unknown', 'ERROR_UNKNOWN_ERROR'),
|
|
463
|
+
login: createErrorStateNode('login', 'ERROR_LOGIN'),
|
|
464
|
+
silentLogin: createErrorStateNode('silent-login', 'ERROR_SILENT_LOGIN'),
|
|
465
|
+
changePassword: createErrorStateNode('change-password', 'ERROR_CHANGE_PASSWORD'),
|
|
466
|
+
forgotPassword: createErrorStateNode('forgot-password', 'ERROR_FORGOT_PASSWORD'),
|
|
467
|
+
resetPassword: createErrorStateNode('reset-password', 'ERROR_RESET_PASSWORD'),
|
|
468
|
+
logout: createErrorStateNode('logout', 'ERROR_LOGOUT_ERROR'),
|
|
469
|
+
mapping: createErrorStateNode('mapping', 'ERROR_MAPPING'),
|
|
470
470
|
},
|
|
471
471
|
on: this.onIdleEvents(),
|
|
472
472
|
},
|
package/dist/esm/routes/base.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { createInputEmitter, createSelectEmitter, EventEmitter, targetChecked, } from '@genesislcap/foundation-events';
|
|
3
|
+
import { I18next } from '@genesislcap/foundation-i18n';
|
|
3
4
|
import { User } from '@genesislcap/foundation-user';
|
|
4
5
|
import { toElementStyles } from '@genesislcap/foundation-utils';
|
|
5
6
|
import { SecondaryRapidColorHEX } from '@genesislcap/foundation-zero';
|
|
6
7
|
import { attr, css, customElement, FASTElement, html, observable, when, } from '@microsoft/fast-element';
|
|
7
8
|
import { Container } from '@microsoft/fast-foundation';
|
|
8
9
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
10
|
+
import merge from 'lodash/merge';
|
|
9
11
|
import { AuthConfig, defaultAuthConfig } from '../config/config';
|
|
10
12
|
import { AuthStore } from '../store';
|
|
11
13
|
import { buttonTag, checkboxTag, progressRingTag, textFieldTag } from '../tags';
|
|
@@ -29,6 +31,8 @@ export class ConfigHostElement extends EventEmitter(FASTElement) {
|
|
|
29
31
|
this.config = this.container.has(AuthConfig, true)
|
|
30
32
|
? this.container.get(AuthConfig)
|
|
31
33
|
: defaultAuthConfig;
|
|
34
|
+
const localizationResources = merge(defaultAuthConfig.localizationResources, this.config.localizationResources);
|
|
35
|
+
this.i18next.addResources(localizationResources);
|
|
32
36
|
super.connectedCallback();
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -38,6 +42,9 @@ __decorate([
|
|
|
38
42
|
__decorate([
|
|
39
43
|
observable
|
|
40
44
|
], ConfigHostElement.prototype, "config", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
I18next
|
|
47
|
+
], ConfigHostElement.prototype, "i18next", void 0);
|
|
41
48
|
/**
|
|
42
49
|
* @internal
|
|
43
50
|
*/
|
|
@@ -46,6 +53,9 @@ export class BaseRoute extends ConfigHostElement {
|
|
|
46
53
|
super(...arguments);
|
|
47
54
|
this.onBack = () => this.routing.navigateTo('/');
|
|
48
55
|
}
|
|
56
|
+
toLocalisedText(text) {
|
|
57
|
+
return this.i18next.t(`${defaultAuthConfig.name}:${text}`, { lng: this.i18next.language });
|
|
58
|
+
}
|
|
49
59
|
}
|
|
50
60
|
__decorate([
|
|
51
61
|
User
|
|
@@ -74,7 +84,7 @@ export const organisationField = () => html `
|
|
|
74
84
|
?required="${(x) => x.config.fields.organisation.required !== false}"
|
|
75
85
|
>
|
|
76
86
|
<span class="form-title">
|
|
77
|
-
${(x) => { var _a; return (_a = x.config.fields.organisation.label) !== null && _a !== void 0 ? _a : '
|
|
87
|
+
${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.organisation.label) !== null && _a !== void 0 ? _a : 'ORGANISATION_TITLE'); }}
|
|
78
88
|
</span>
|
|
79
89
|
</${textFieldTag}>
|
|
80
90
|
`)}
|
|
@@ -97,7 +107,7 @@ export const usernameField = () => html `
|
|
|
97
107
|
title="${(x) => x.config.fields.username.title}"
|
|
98
108
|
required
|
|
99
109
|
>
|
|
100
|
-
<span class="form-title">${(x) => { var _a; return (_a = x.config.fields.username.label) !== null && _a !== void 0 ? _a : '
|
|
110
|
+
<span class="form-title">${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.username.label) !== null && _a !== void 0 ? _a : 'FIELD_USERNAME_TITLE'); }}</span>
|
|
101
111
|
</${textFieldTag}>
|
|
102
112
|
`;
|
|
103
113
|
/**
|
|
@@ -115,7 +125,7 @@ export const emailField = () => html `
|
|
|
115
125
|
@input="${inputEmit('auth-email-changed')}"
|
|
116
126
|
required
|
|
117
127
|
>
|
|
118
|
-
<span class="form-title">${(x) => { var _a; return (_a = x.config.fields.email.label) !== null && _a !== void 0 ? _a : '
|
|
128
|
+
<span class="form-title">${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.email.label) !== null && _a !== void 0 ? _a : 'FIELD_EMAIL_TITLE'); }}</span>
|
|
119
129
|
</${textFieldTag}>
|
|
120
130
|
`)}
|
|
121
131
|
`;
|
|
@@ -133,12 +143,12 @@ export const passwordField = (label) => html `
|
|
|
133
143
|
@input="${inputEmit('auth-password-changed')}"
|
|
134
144
|
required
|
|
135
145
|
>
|
|
136
|
-
<span class="form-title">${(x) => { var _a; return (_a = label !== null && label !== void 0 ? label : x.config.fields.password.label) !== null && _a !== void 0 ? _a : '
|
|
146
|
+
<span class="form-title">${(x) => { var _a; return x.toLocalisedText((_a = label !== null && label !== void 0 ? label : x.config.fields.password.label) !== null && _a !== void 0 ? _a : 'FIELD_PASSWORD_TITLE'); }}</span>
|
|
137
147
|
</${textFieldTag}>
|
|
138
148
|
`;
|
|
139
149
|
const password2FieldMeta = {
|
|
140
|
-
new: ['new-password', '
|
|
141
|
-
confirmation: ['password-confirmation', '
|
|
150
|
+
new: ['new-password', 'FIELD_PASSWORD_NEW_TITLE'],
|
|
151
|
+
confirmation: ['password-confirmation', 'FIELD_PASSWORD_CONFIRM_TITLE'],
|
|
142
152
|
};
|
|
143
153
|
/**
|
|
144
154
|
* @internal
|
|
@@ -156,7 +166,7 @@ export const password2Field = (type) => {
|
|
|
156
166
|
@input="${inputEmit('auth-password2-changed')}"
|
|
157
167
|
required
|
|
158
168
|
>
|
|
159
|
-
<span class="form-title">${label}</span>
|
|
169
|
+
<span class="form-title">${(x) => x.toLocalisedText(label)}</span>
|
|
160
170
|
</${textFieldTag}>
|
|
161
171
|
`;
|
|
162
172
|
};
|
|
@@ -266,7 +276,7 @@ LogoElement = __decorate([
|
|
|
266
276
|
/**
|
|
267
277
|
* @internal
|
|
268
278
|
*/
|
|
269
|
-
export const backButton = (binding) => html `
|
|
279
|
+
export const backButton = (binding, label) => html `
|
|
270
280
|
<${buttonTag}
|
|
271
281
|
appearance="neutral-grey"
|
|
272
282
|
type="button"
|
|
@@ -274,7 +284,7 @@ export const backButton = (binding) => html `
|
|
|
274
284
|
@click=${binding}
|
|
275
285
|
data-test-id="back"
|
|
276
286
|
>
|
|
277
|
-
|
|
287
|
+
${label}
|
|
278
288
|
</${buttonTag}>
|
|
279
289
|
`;
|
|
280
290
|
/**
|
|
@@ -311,8 +321,9 @@ export const showPasswordsCheckbox = () => html `
|
|
|
311
321
|
*/
|
|
312
322
|
let MessageElement = class MessageElement extends FASTElement {
|
|
313
323
|
get message() {
|
|
314
|
-
const
|
|
315
|
-
const
|
|
324
|
+
const translateHelper = (metaMessage) => this.i18next.t(`${defaultAuthConfig.name}:${metaMessage}`, { lng: this.i18next.language });
|
|
325
|
+
const meta = this.store.metaMessages.map(translateHelper).join('\n');
|
|
326
|
+
const error = this.store.errorMessages.map(translateHelper).join('\n');
|
|
316
327
|
return !error ? meta : `${meta} ${error}.`;
|
|
317
328
|
}
|
|
318
329
|
get hasError() {
|
|
@@ -325,6 +336,9 @@ let MessageElement = class MessageElement extends FASTElement {
|
|
|
325
336
|
__decorate([
|
|
326
337
|
AuthStore
|
|
327
338
|
], MessageElement.prototype, "store", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
I18next
|
|
341
|
+
], MessageElement.prototype, "i18next", void 0);
|
|
328
342
|
MessageElement = __decorate([
|
|
329
343
|
customElement({
|
|
330
344
|
name: 'auth-message',
|
|
@@ -11,13 +11,13 @@ export const ForgotPasswordTemplate = html `
|
|
|
11
11
|
<${cardTag} class="card-pd">
|
|
12
12
|
<div class="column-content">
|
|
13
13
|
<auth-logo></auth-logo>
|
|
14
|
-
<div class="heading2" data-test-id="heading"
|
|
15
|
-
<div class="heading3"
|
|
14
|
+
<div class="heading2" data-test-id="heading">${(x) => x.toLocalisedText('FORGOTTEN_PASSWORD_TITLE')}</div>
|
|
15
|
+
<div class="heading3">${(x) => x.toLocalisedText('FORGOTTEN_PASSWORD_SUBTITLE')}</div>
|
|
16
16
|
</div>
|
|
17
17
|
<form @submit=${(x) => x.onSubmit()} data-test-id="form">
|
|
18
18
|
${organisationField()} ${usernameField()}
|
|
19
19
|
<div class="form-buttons">
|
|
20
|
-
${
|
|
20
|
+
${(x) => submitButton(x.toLocalisedText('FORGOTTEN_PASSWORD_SUBMIT_BUTTON'))} ${(x) => backButton(() => x.onBack(), x.toLocalisedText('FORGOTTEN_PASSWORD_BACK_BUTTON'))}
|
|
21
21
|
</div>
|
|
22
22
|
<submitting-indicator is-submitting="${(x) => x.store.isPending}"></submitting-indicator>
|
|
23
23
|
<auth-message></auth-message>
|
|
@@ -48,7 +48,9 @@ let Login = class Login extends BaseRoute {
|
|
|
48
48
|
get ssoToggleLabel() {
|
|
49
49
|
const { selectedIdp, ssoToggled } = this.store.formEntry;
|
|
50
50
|
const selectedIDPLabel = selectedIdp ? ` - ${selectedIdp.id}` : '';
|
|
51
|
-
return ssoToggled
|
|
51
|
+
return ssoToggled
|
|
52
|
+
? this.toLocalisedText('LOGIN_SSO_CHECKBOX_ENABLED_TITLE') + selectedIDPLabel
|
|
53
|
+
: this.toLocalisedText('LOGIN_SSO_CHECKBOX');
|
|
52
54
|
}
|
|
53
55
|
onSSOLogin() {
|
|
54
56
|
const ssoLoginUrl = this.store.formEntry.ssoLoginUrl;
|
|
@@ -5,10 +5,10 @@ import { organisationField, passwordField, showPasswordsCheckbox, usernameField,
|
|
|
5
5
|
const regularLogin = html `
|
|
6
6
|
${when((login) => !login.store.formEntry.ssoToggled, html `
|
|
7
7
|
${organisationField()} ${usernameField()} ${passwordField()}
|
|
8
|
-
<span class="case-warning"
|
|
8
|
+
<span class="case-warning">${(x) => x.toLocalisedText('LOGIN_CASE_WARNING')}</span>
|
|
9
9
|
${showPasswordsCheckbox()}
|
|
10
10
|
<div class="form-buttons">
|
|
11
|
-
${(x) => submitButton('
|
|
11
|
+
${(x) => submitButton(x.toLocalisedText('LOGIN_SUBMIT_BUTTON'), 'submit', x.submitDisabled)}
|
|
12
12
|
<div class="links">
|
|
13
13
|
<div class="password-links">
|
|
14
14
|
${when((x) => !x.config.omitRoutes.includes('forgot-password'), html `
|
|
@@ -18,7 +18,7 @@ const regularLogin = html `
|
|
|
18
18
|
@click=${(x) => x.routing.navigateTo(`forgot-password`)}
|
|
19
19
|
data-test-id="forgot-password"
|
|
20
20
|
>
|
|
21
|
-
|
|
21
|
+
${(x) => x.toLocalisedText('LOGIN_FORGOT_PASSWORD_LINK')}
|
|
22
22
|
</${anchorTag}>
|
|
23
23
|
`)}
|
|
24
24
|
${when((x) => !x.config.omitRoutes.includes('reset-password'), html `
|
|
@@ -28,7 +28,7 @@ const regularLogin = html `
|
|
|
28
28
|
@click=${(x) => x.routing.navigateTo(`reset-password`)}
|
|
29
29
|
data-test-id="reset-password"
|
|
30
30
|
>
|
|
31
|
-
|
|
31
|
+
${(x) => x.toLocalisedText('LOGIN_CHANGE_PASSWORD_LINK')}
|
|
32
32
|
</${anchorTag}>
|
|
33
33
|
`)}
|
|
34
34
|
</div>
|
|
@@ -40,7 +40,7 @@ const regularLogin = html `
|
|
|
40
40
|
@click=${(x) => x.routing.navigateTo(`request-account`)}
|
|
41
41
|
data-test-id="request-account"
|
|
42
42
|
>
|
|
43
|
-
|
|
43
|
+
${(x) => x.toLocalisedText('LOGIN_REQUEST_ACCOUNT_LINK')}
|
|
44
44
|
</${anchorTag}>
|
|
45
45
|
`)}
|
|
46
46
|
</div>
|
|
@@ -82,7 +82,7 @@ const ssoLogin = html `
|
|
|
82
82
|
data-test-id="submit"
|
|
83
83
|
?disabled=${(x) => !x.store.formEntry.selectedIdp}
|
|
84
84
|
>
|
|
85
|
-
|
|
85
|
+
${(x) => x.toLocalisedText('LOGIN_SSO_BUTTON')}
|
|
86
86
|
</${buttonTag}>
|
|
87
87
|
</div>
|
|
88
88
|
`)}
|
|
@@ -97,7 +97,7 @@ export const LoginTemplate = html `
|
|
|
97
97
|
<${cardTag} class="card-pd">
|
|
98
98
|
<div class="column-content">
|
|
99
99
|
<auth-logo></auth-logo>
|
|
100
|
-
<div class="heading2" data-test-id="heading"
|
|
100
|
+
<div class="heading2" data-test-id="heading">${(x) => x.toLocalisedText('LOGIN_TITLE')}</div>
|
|
101
101
|
</div>
|
|
102
102
|
<form
|
|
103
103
|
id="auth-login"
|
|
@@ -12,7 +12,7 @@ NotFound = __decorate([
|
|
|
12
12
|
customElement({
|
|
13
13
|
name: 'foundation-auth-not-found',
|
|
14
14
|
template: html `
|
|
15
|
-
<h1 data-test-id="not-found"
|
|
15
|
+
<h1 data-test-id="not-found">${(x) => x.toLocalisedText('NOT_FOUND_TITLE')}</h1>
|
|
16
16
|
`,
|
|
17
17
|
styles: commonStyles,
|
|
18
18
|
})
|
|
@@ -12,7 +12,7 @@ export const ProtectedTemplate = html `
|
|
|
12
12
|
@click=${(x) => x.onLogout()}
|
|
13
13
|
data-test-id="logout"
|
|
14
14
|
>
|
|
15
|
-
|
|
15
|
+
${(x) => x.toLocalisedText('LOGOUT_BUTTON')}
|
|
16
16
|
</${buttonTag}>
|
|
17
17
|
<${buttonTag}
|
|
18
18
|
type="button"
|
|
@@ -20,7 +20,7 @@ export const ProtectedTemplate = html `
|
|
|
20
20
|
?disabled=${(x) => x.isSocketOpen}
|
|
21
21
|
data-test-id="open-socket"
|
|
22
22
|
>
|
|
23
|
-
|
|
23
|
+
${(x) => x.toLocalisedText('OPEN_SOCKET_BUTTON')}
|
|
24
24
|
</${buttonTag}>
|
|
25
25
|
<${buttonTag}
|
|
26
26
|
type="button"
|
|
@@ -28,7 +28,7 @@ export const ProtectedTemplate = html `
|
|
|
28
28
|
?disabled=${(x) => !x.isSocketOpen}
|
|
29
29
|
data-test-id="close-socket"
|
|
30
30
|
>
|
|
31
|
-
|
|
31
|
+
${(x) => x.toLocalisedText('CLOSE_SOCKET_BUTTON')}
|
|
32
32
|
</${buttonTag}>
|
|
33
33
|
<${buttonTag}
|
|
34
34
|
type="button"
|
|
@@ -36,7 +36,7 @@ export const ProtectedTemplate = html `
|
|
|
36
36
|
?disabled=${(x) => !x.isSocketOpen}
|
|
37
37
|
data-test-id="snapshot-socket"
|
|
38
38
|
>
|
|
39
|
-
|
|
39
|
+
${(x) => x.toLocalisedText('SNAPSHOT_SOCKET_BUTTON')}
|
|
40
40
|
</${buttonTag}>
|
|
41
41
|
</div>
|
|
42
42
|
`;
|
|
@@ -21,14 +21,11 @@ export const RequestAccountTemplate = html `
|
|
|
21
21
|
name="terms"
|
|
22
22
|
:value=${sync((x) => x.termsAgreed, 'boolean')}
|
|
23
23
|
data-test-id="terms"
|
|
24
|
+
:innerHTML="${(x) => x.toLocalisedText('REQUEST_ACCOUNT_TERMS_HTML')}"
|
|
24
25
|
>
|
|
25
|
-
I agree to the
|
|
26
|
-
<stong>Terms</stong>
|
|
27
|
-
and
|
|
28
|
-
<stong>Conditions</stong>
|
|
29
26
|
</${checkboxTag}>
|
|
30
27
|
<div class="form-buttons">
|
|
31
|
-
${submitButton('
|
|
28
|
+
${(x) => submitButton(x.toLocalisedText('REQUEST_ACCOUNT_SUBMIT_BUTTON'))} ${(x) => backButton(() => x.onBack(), x.toLocalisedText('REQUEST_ACCOUNT_BUTTON_BACK'))}
|
|
32
29
|
</div>
|
|
33
30
|
<submitting-indicator is-submitting="${(x) => x.store.isPending}"></submitting-indicator>
|
|
34
31
|
<auth-message></auth-message>
|
|
@@ -12,16 +12,17 @@ export const ResetPasswordTemplate = html `
|
|
|
12
12
|
<div class="column-content">
|
|
13
13
|
<auth-logo></auth-logo>
|
|
14
14
|
<div class="heading2" data-test-id="heading">${(x) => x.headingText}</div>
|
|
15
|
-
<div class="heading3"
|
|
15
|
+
<div class="heading3">${(x) => x.toLocalisedText('RESET_PASSWORD_SUBTITLE')}</div>
|
|
16
16
|
</div>
|
|
17
17
|
<form @submit=${(x) => x.onSubmit()} autocomplete="on" data-test-id="form">
|
|
18
18
|
${organisationField()} ${usernameField()}
|
|
19
19
|
${when((x) => !x.passwordResetToken, html `
|
|
20
|
-
${passwordField('
|
|
20
|
+
${(x) => passwordField(x.toLocalisedText('RESET_PASSWORD_OLD_PASSWORD_FIELD'))}
|
|
21
21
|
`)}
|
|
22
22
|
${password2Field('new')} ${showPasswordsCheckbox()}
|
|
23
23
|
<div class="form-buttons">
|
|
24
|
-
${
|
|
24
|
+
${(x) => submitButton(x.toLocalisedText('RESET_PASSWORD_SUBMIT_BUTTON'))}
|
|
25
|
+
${(x) => backButton(() => x.onBack(), x.toLocalisedText('RESET_PASSWORD_BACK_BUTTON'))}
|
|
25
26
|
</div>
|
|
26
27
|
<submitting-indicator is-submitting="${(x) => x.store.isPending}"></submitting-indicator>
|
|
27
28
|
<auth-message></auth-message>
|
|
@@ -12,9 +12,9 @@ export const VerifyTemplate = html `
|
|
|
12
12
|
<${cardTag} class="card-pd">
|
|
13
13
|
<div class="column-content">
|
|
14
14
|
<auth-logo></auth-logo>
|
|
15
|
-
<div class="heading2" data-test-id="heading"
|
|
15
|
+
<div class="heading2" data-test-id="heading">${(x) => x.toLocalisedText('VERIFY_TITLE')}</div>
|
|
16
16
|
<div class="heading3">
|
|
17
|
-
|
|
17
|
+
${(x) => x.toLocalisedText('VERIFY_SUBTITLE')}
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
<form @submit=${(x) => x.onSubmit()} data-test-id="form">
|
|
@@ -26,10 +26,10 @@ export const VerifyTemplate = html `
|
|
|
26
26
|
autofocus
|
|
27
27
|
data-test-id="code"
|
|
28
28
|
>
|
|
29
|
-
<span class="form-title"
|
|
29
|
+
<span class="form-title">${(x) => x.toLocalisedText('VERIFY_FORM_TITLE')}</span>
|
|
30
30
|
</${textFieldTag}>
|
|
31
31
|
<div class="form-buttons">
|
|
32
|
-
${
|
|
32
|
+
${(x) => submitButton(x.toLocalisedText('VERIFY_SUBMIT_BUTTON_LABEL'))} ${(x) => backButton(() => x.onBack(), x.toLocalisedText('VERIFY_BACK_BUTTON'))}
|
|
33
33
|
</div>
|
|
34
34
|
<submitting-indicator is-submitting="${(x) => x.store.isPending}"></submitting-indicator>
|
|
35
35
|
<auth-message></auth-message>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"foundation-auth": {
|
|
4
|
+
"FORGOTTEN_PASSWORD_TITLE": "Forgotten Password",
|
|
5
|
+
"FORGOTTEN_PASSWORD_SUBTITLE": "Enter your account username",
|
|
6
|
+
"FORGOTTEN_PASSWORD_SUBMIT_BUTTON": "Send Recovery Link",
|
|
7
|
+
"FORGOTTEN_PASSWORD_BACK_BUTTON": "Back",
|
|
8
|
+
"LOGIN_CASE_WARNING": "*Fields are case-sensitive",
|
|
9
|
+
"LOGIN_SUBMIT_BUTTON": "Login",
|
|
10
|
+
"LOGIN_FORGOT_PASSWORD_LINK": "Forgot Password?",
|
|
11
|
+
"LOGIN_CHANGE_PASSWORD_LINK": "Change Password",
|
|
12
|
+
"LOGIN_REQUEST_ACCOUNT_LINK": "Request Account",
|
|
13
|
+
"LOGIN_SSO_BUTTON": "SSO Login",
|
|
14
|
+
"LOGIN_TITLE": "Login",
|
|
15
|
+
"LOGIN_SSO_CHECKBOX": "Enable SSO?",
|
|
16
|
+
"LOGIN_SSO_CHECKBOX_ENABLED_TITLE": "SSO Enabled",
|
|
17
|
+
"NOT_FOUND_TITLE": "Not found! 404",
|
|
18
|
+
"LOGOUT_BUTTON": "Logout",
|
|
19
|
+
"OPEN_SOCKET_BUTTON": "Open Socket",
|
|
20
|
+
"CLOSE_SOCKET_BUTTON": "Close Socket",
|
|
21
|
+
"SNAPSHOT_SOCKET_BUTTON": "Snapshot Socket",
|
|
22
|
+
"ORGANISATION_TITLE": "Organisation",
|
|
23
|
+
"REQUEST_ACCOUNT_TERMS_HTML": "I agree to the <strong>Terms</strong> and <strong>Conditions</strong>",
|
|
24
|
+
"REQUEST_ACCOUNT_SUBMIT_BUTTON": "Request Account",
|
|
25
|
+
"REQUEST_ACCOUNT_BUTTON_BACK": "Back",
|
|
26
|
+
"RESET_PASSWORD_SUBTITLE": "Enter the username registered to your account",
|
|
27
|
+
"RESET_PASSWORD_OLD_PASSWORD_FIELD": "Old Password",
|
|
28
|
+
"RESET_PASSWORD_SUBMIT_BUTTON": "Change Password",
|
|
29
|
+
"RESET_PASSWORD_BACK_BUTTON": "Back",
|
|
30
|
+
"VERIFY_TITLE": "Verify that it's you",
|
|
31
|
+
"VERIFY_SUBTITLE": "We've sent a code to the email address attached to this account.",
|
|
32
|
+
"VERIFY_FORM_TITLE": "Verification Code",
|
|
33
|
+
"VERIFY_SUBMIT_BUTTON_LABEL": "Verify and Login",
|
|
34
|
+
"VERIFY_BACK_BUTTON": "Back",
|
|
35
|
+
"FIELD_USERNAME_TITLE": "Username",
|
|
36
|
+
"FIELD_EMAIL_TITLE": "Email",
|
|
37
|
+
"FIELD_PASSWORD_TITLE": "Password",
|
|
38
|
+
"FIELD_PASSWORD_NEW_TITLE": "New Password",
|
|
39
|
+
"FIELD_PASSWORD_CONFIRM_TITLE": "Confirm Password",
|
|
40
|
+
"MESSAGE_PASSWORD_CHANGE_SUCCESS": "Password change success.",
|
|
41
|
+
"MESSAGE_FORGOT_PASSWORD_RESET": "Please check your inbox for reset instructions.",
|
|
42
|
+
"MESSAGE_PASSWORD_RESET_SUCCESS": "Password reset success.",
|
|
43
|
+
"MESSAGE_INCORRECT_CREDENTIALS": "Incorrect credentials, please try again.",
|
|
44
|
+
"MESSAGE_MFA_REQUIRED": "Please check your inbox for your login link.",
|
|
45
|
+
"MESSAGE_PASSWORD_EXPIRED": "You are required to change your password.",
|
|
46
|
+
"ERROR_UNKNOWN_ERROR": "Unknown error.",
|
|
47
|
+
"ERROR_LOGIN": "Login error.",
|
|
48
|
+
"ERROR_SILENT_LOGIN": "Silent login error.",
|
|
49
|
+
"ERROR_CHANGE_PASSWORD": "Change password error.",
|
|
50
|
+
"ERROR_FORGOT_PASSWORD": "Forgot password error.",
|
|
51
|
+
"ERROR_RESET_PASSWORD": "Reset password error.",
|
|
52
|
+
"ERROR_LOGOUT_ERROR": "Logout error.",
|
|
53
|
+
"ERROR_MAPPING": "Mapping error."
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -358,6 +358,38 @@
|
|
|
358
358
|
"endIndex": 2
|
|
359
359
|
}
|
|
360
360
|
},
|
|
361
|
+
{
|
|
362
|
+
"kind": "PropertySignature",
|
|
363
|
+
"canonicalReference": "@genesislcap/foundation-auth!AuthConfig#localizationResources:member",
|
|
364
|
+
"docComment": "/**\n * I18n resources.\n *\n * @remarks\n *\n * This property holds the localization resources needed for internationalization of the application. It should follow the structure defined by the I18nextConfig interface, which includes translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each namespace includes key-value pairs for translation strings.\n *\n * @example\n * ```ts\n * resources: {\n * en: {\n * 'foundation-auth': {\n * key: 'Hello World'\n * }\n * },\n * es: {\n * 'foundation-auth': {\n * key: 'Hola Mundo'\n * }\n * }\n * }\n * ```\n *\n */\n",
|
|
365
|
+
"excerptTokens": [
|
|
366
|
+
{
|
|
367
|
+
"kind": "Content",
|
|
368
|
+
"text": "localizationResources?: "
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"kind": "Reference",
|
|
372
|
+
"text": "I18nextConfig",
|
|
373
|
+
"canonicalReference": "@genesislcap/foundation-i18n!I18nextConfig:interface"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"kind": "Content",
|
|
377
|
+
"text": "['resources']"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"kind": "Content",
|
|
381
|
+
"text": ";"
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"isReadonly": false,
|
|
385
|
+
"isOptional": true,
|
|
386
|
+
"releaseTag": "Public",
|
|
387
|
+
"name": "localizationResources",
|
|
388
|
+
"propertyTypeTokenRange": {
|
|
389
|
+
"startIndex": 1,
|
|
390
|
+
"endIndex": 3
|
|
391
|
+
}
|
|
392
|
+
},
|
|
361
393
|
{
|
|
362
394
|
"kind": "PropertySignature",
|
|
363
395
|
"canonicalReference": "@genesislcap/foundation-auth!AuthConfig#logo:member",
|
|
@@ -23,6 +23,7 @@ import { EventObject } from 'xstate';
|
|
|
23
23
|
import { FetchMachine } from '@genesislcap/foundation-state-machine';
|
|
24
24
|
import { FetchMachineEvent } from '@genesislcap/foundation-state-machine';
|
|
25
25
|
import { getUser } from '@genesislcap/foundation-user';
|
|
26
|
+
import { I18nextConfig } from '@genesislcap/foundation-i18n';
|
|
26
27
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
27
28
|
import type { InterpreterOptions } from 'xstate';
|
|
28
29
|
import { Logger } from '@genesislcap/foundation-logger';
|
|
@@ -198,6 +199,32 @@ export declare interface AuthConfig extends PartialFASTElementDefinition {
|
|
|
198
199
|
* The amount of seconds to display user feedback messages, such as "check your inbox" etc. Defaults to 3 seconds.
|
|
199
200
|
*/
|
|
200
201
|
feedbackDelay?: number;
|
|
202
|
+
/**
|
|
203
|
+
* I18n resources.
|
|
204
|
+
*
|
|
205
|
+
* @remarks
|
|
206
|
+
* This property holds the localization resources needed for internationalization of the application.
|
|
207
|
+
* It should follow the structure defined by the I18nextConfig interface, which includes
|
|
208
|
+
* translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each
|
|
209
|
+
* namespace includes key-value pairs for translation strings.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```ts
|
|
213
|
+
* resources: {
|
|
214
|
+
* en: {
|
|
215
|
+
* 'foundation-auth': {
|
|
216
|
+
* key: 'Hello World'
|
|
217
|
+
* }
|
|
218
|
+
* },
|
|
219
|
+
* es: {
|
|
220
|
+
* 'foundation-auth': {
|
|
221
|
+
* key: 'Hola Mundo'
|
|
222
|
+
* }
|
|
223
|
+
* }
|
|
224
|
+
* }
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
localizationResources?: I18nextConfig['resources'];
|
|
201
228
|
}
|
|
202
229
|
|
|
203
230
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [AuthConfig](./foundation-auth.authconfig.md) > [localizationResources](./foundation-auth.authconfig.localizationresources.md)
|
|
4
|
+
|
|
5
|
+
## AuthConfig.localizationResources property
|
|
6
|
+
|
|
7
|
+
I18n resources.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
localizationResources?: I18nextConfig['resources'];
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
This property holds the localization resources needed for internationalization of the application. It should follow the structure defined by the I18nextConfig interface, which includes translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each namespace includes key-value pairs for translation strings.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
resources: {
|
|
24
|
+
en: {
|
|
25
|
+
'foundation-auth': {
|
|
26
|
+
key: 'Hello World'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
es: {
|
|
30
|
+
'foundation-auth': {
|
|
31
|
+
key: 'Hola Mundo'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
@@ -22,6 +22,7 @@ export interface AuthConfig extends PartialFASTElementDefinition
|
|
|
22
22
|
| [feedbackDelay?](./foundation-auth.authconfig.feedbackdelay.md) | | number | _(Optional)_ Feedback delay. |
|
|
23
23
|
| [fields](./foundation-auth.authconfig.fields.md) | | [FieldConfigMap](./foundation-auth.fieldconfigmap.md) | Map of configuration for each of the primary form fields. |
|
|
24
24
|
| [hostPath](./foundation-auth.authconfig.hostpath.md) | | string | The <code>path</code> of the micro frontend as defined in the parent / host route. |
|
|
25
|
+
| [localizationResources?](./foundation-auth.authconfig.localizationresources.md) | | I18nextConfig\['resources'\] | _(Optional)_ I18n resources. |
|
|
25
26
|
| [logo](./foundation-auth.authconfig.logo.md) | | ComposableStyles \| ComposableStyles\[\] \| null | Logo styles. |
|
|
26
27
|
| [omitRedirectUrls](./foundation-auth.authconfig.omitredirecturls.md) | | string\[\] | Omit certain return URLs which the session service may have captured. |
|
|
27
28
|
| [omitRoutes](./foundation-auth.authconfig.omitroutes.md) | | Exclude<[AuthRoutes](./foundation-auth.authroutes.md)<!-- -->, 'login' \| 'not-found'>\[\] | Omit any of the internal routes except 'login' and 'not-found'. |
|
package/docs/api-report.md
CHANGED
|
@@ -29,6 +29,7 @@ import { EventObject } from 'xstate';
|
|
|
29
29
|
import { FetchMachine } from '@genesislcap/foundation-state-machine';
|
|
30
30
|
import { FetchMachineEvent } from '@genesislcap/foundation-state-machine';
|
|
31
31
|
import { getUser } from '@genesislcap/foundation-user';
|
|
32
|
+
import { I18nextConfig } from '@genesislcap/foundation-i18n';
|
|
32
33
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
33
34
|
import type { InterpreterOptions } from 'xstate';
|
|
34
35
|
import { Logger } from '@genesislcap/foundation-logger';
|
|
@@ -81,6 +82,7 @@ export interface AuthConfig extends PartialFASTElementDefinition {
|
|
|
81
82
|
feedbackDelay?: number;
|
|
82
83
|
fields: FieldConfigMap;
|
|
83
84
|
hostPath: string;
|
|
85
|
+
localizationResources?: I18nextConfig['resources'];
|
|
84
86
|
logo: ComposableStyles | ComposableStyles[] | null;
|
|
85
87
|
omitRedirectUrls: string[];
|
|
86
88
|
omitRoutes: Exclude<AuthRoutes, 'login' | 'not-found'>[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-auth",
|
|
3
3
|
"description": "Genesis Foundation Auth",
|
|
4
|
-
"version": "14.180.
|
|
4
|
+
"version": "14.180.8",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-auth.d.ts",
|
|
@@ -127,25 +127,26 @@
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
|
-
"@genesislcap/foundation-testing": "14.180.
|
|
131
|
-
"@genesislcap/genx": "14.180.
|
|
132
|
-
"@genesislcap/rollup-builder": "14.180.
|
|
133
|
-
"@genesislcap/ts-builder": "14.180.
|
|
134
|
-
"@genesislcap/uvu-playwright-builder": "14.180.
|
|
135
|
-
"@genesislcap/vite-builder": "14.180.
|
|
136
|
-
"@genesislcap/webpack-builder": "14.180.
|
|
130
|
+
"@genesislcap/foundation-testing": "14.180.8",
|
|
131
|
+
"@genesislcap/genx": "14.180.8",
|
|
132
|
+
"@genesislcap/rollup-builder": "14.180.8",
|
|
133
|
+
"@genesislcap/ts-builder": "14.180.8",
|
|
134
|
+
"@genesislcap/uvu-playwright-builder": "14.180.8",
|
|
135
|
+
"@genesislcap/vite-builder": "14.180.8",
|
|
136
|
+
"@genesislcap/webpack-builder": "14.180.8",
|
|
137
137
|
"rimraf": "^3.0.2"
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
|
-
"@genesislcap/foundation-comms": "14.180.
|
|
141
|
-
"@genesislcap/foundation-events": "14.180.
|
|
142
|
-
"@genesislcap/foundation-
|
|
143
|
-
"@genesislcap/foundation-
|
|
144
|
-
"@genesislcap/foundation-
|
|
145
|
-
"@genesislcap/foundation-
|
|
146
|
-
"@genesislcap/foundation-
|
|
147
|
-
"@genesislcap/foundation-
|
|
148
|
-
"@genesislcap/foundation-
|
|
140
|
+
"@genesislcap/foundation-comms": "14.180.8",
|
|
141
|
+
"@genesislcap/foundation-events": "14.180.8",
|
|
142
|
+
"@genesislcap/foundation-i18n": "14.180.8",
|
|
143
|
+
"@genesislcap/foundation-logger": "14.180.8",
|
|
144
|
+
"@genesislcap/foundation-state-machine": "14.180.8",
|
|
145
|
+
"@genesislcap/foundation-store": "14.180.8",
|
|
146
|
+
"@genesislcap/foundation-ui": "14.180.8",
|
|
147
|
+
"@genesislcap/foundation-user": "14.180.8",
|
|
148
|
+
"@genesislcap/foundation-utils": "14.180.8",
|
|
149
|
+
"@genesislcap/foundation-zero": "14.180.8",
|
|
149
150
|
"@microsoft/fast-components": "^2.30.6",
|
|
150
151
|
"@microsoft/fast-element": "^1.12.0",
|
|
151
152
|
"@microsoft/fast-foundation": "^2.49.4",
|
|
@@ -154,6 +155,7 @@
|
|
|
154
155
|
"cockatiel": "^3.1.1",
|
|
155
156
|
"http-status-codes": "^2.2.0",
|
|
156
157
|
"js-cookie": "^3.0.1",
|
|
158
|
+
"lodash": "^4.17.21",
|
|
157
159
|
"tslib": "^2.3.1",
|
|
158
160
|
"xstate": "5.0.0-beta.21"
|
|
159
161
|
},
|
|
@@ -165,5 +167,5 @@
|
|
|
165
167
|
"publishConfig": {
|
|
166
168
|
"access": "public"
|
|
167
169
|
},
|
|
168
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "bc07102d061a18ece059dd03a4d1d9d585548343"
|
|
169
171
|
}
|