@genesislcap/foundation-auth 15.24.0-FUI-2603.10 → 15.24.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/dist/dts/machine/actions.d.ts.map +1 -1
- package/dist/dts/machine/machine.d.ts.map +1 -1
- package/dist/dts/mapper/utils.d.ts +0 -5
- package/dist/dts/mapper/utils.d.ts.map +1 -1
- package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
- package/dist/esm/machine/actions.js +2 -22
- package/dist/esm/machine/machine.js +28 -96
- package/dist/esm/mapper/utils.js +1 -6
- package/dist/esm/routes/base.js +1 -1
- package/dist/esm/routes/reset-password/reset-password.js +2 -11
- package/dist/esm/translation.json +1 -2
- package/dist/foundation-auth.d.ts +0 -5
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/machine/machine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EACZ,iBAAiB,EAMjB,OAAO,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACL,IAAI,
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/machine/machine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EACZ,iBAAiB,EAMjB,OAAO,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACL,IAAI,EAQL,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAEL,iBAAiB,EAIlB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,iBAAiB,EAQlB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAEV,kBAAkB,EAClB,gBAAgB,EAGhB,WAAW,EACX,WAAW,EAEZ,MAAM,SAAS,CAAC;AAGjB;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;CAAG;AAErF;;;GAGG;AACH,qBAAa,kBACX,SAAQ,eAAe,CAAC,kBAAkB,EAAE,gBAAgB,CAC5D,YAAW,WAAW;IAGd,OAAO,CAAC,IAAI;IACJ,OAAO,CAAC,YAAY;IACf,OAAO,CAAC,EAAE;IACvB,OAAO,CAAC,IAAI;IACC,OAAO,CAAC,aAAa;IAC5B,OAAO,CAAC,MAAM;IACb,OAAO,CAAC,OAAO;gBANd,IAAI,EAAE,IAAI,EACF,YAAY,EAAE,YAAY,EACrB,EAAE,EAAE,iBAAiB,EAClC,IAAI,EAAE,IAAI,EACG,aAAa,EAAE,iBAAiB,EACvC,MAAM,EAAE,UAAU,EACjB,OAAO,EAAE,WAAW;IAipB3C,KAAK,CACH,OAAO,GAAE,kBAAkB,CAAC,OAAO,IAAI,CAAC,OAAO,CAM9C;IAKH;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAIxB,SAAS,CAAC,sBAAsB,IAAI,WAAW;IAQ/C,SAAS,CAAC,+BAA+B,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAuB3E,SAAS,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,iBAAiB;IAgB3E,SAAS,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;MAwBpB;IAEF,SAAS,CAAC,aAAa;;;MAGpB;CACJ;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,mEAA0E,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
|
|
@@ -8,11 +8,6 @@ export declare const fromDTOStringArray: (arr: string[]) => string[];
|
|
|
8
8
|
* getNormalisedText
|
|
9
9
|
* @param arr - A NackErrorWarning array.
|
|
10
10
|
* @returns A combined text string.
|
|
11
|
-
* @remarks
|
|
12
|
-
* Joins message texts with `\n` deliberately so multi-error NACKs render as separate
|
|
13
|
-
* lines under `white-space: pre-line` (e.g. auth MessageElement). Consumers that
|
|
14
|
-
* surface `NackError.message` without a pre-line renderer (toasts, etc.) will see a
|
|
15
|
-
* literal newline where a space was used historically.
|
|
16
11
|
* @internal
|
|
17
12
|
*/
|
|
18
13
|
export declare const getNormalisedText: (arr: NackErrorWarning[]) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mapper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAsB,MAAM,QAAQ,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,EAAE,KAAG,MAAM,EACN,CAAC;AA0CpD
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mapper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAsB,MAAM,QAAQ,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,EAAE,KAAG,MAAM,EACN,CAAC;AA0CpD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,gBAAgB,EAAE,KAAG,MACyB,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,IAAI,EAAE,MAAM,MAAM,YAI7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,GAAG,KAAG,GAGpC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,IAAI,KAAG,IAavC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,iBAAiB,KAAG,gBAMnD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,IAAI,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,IAAI,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,EACD,WAAW,GAAE,MAA0C,GACtD,WAAW,CAWb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;;;;;;;;;;GAaG;AACH,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAE5C,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;;;;;;;;;;GAaG;AACH,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAE5C,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAKhC,QAAQ;IAwBd,IACI,WAAW,mEAEd;CACF"}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isErrorEvent } from '@genesislcap/foundation-state-machine';
|
|
2
2
|
import { assign } from 'xstate';
|
|
3
|
-
import { fromDTONack, isNackDTO } from '../mapper';
|
|
4
3
|
import { logger } from '../utils';
|
|
5
4
|
import { NackError } from './errors';
|
|
6
5
|
import { is200Nack } from './guards';
|
|
7
|
-
const nackErrorFrom = (value) => {
|
|
8
|
-
if (isNackDTO(value)) {
|
|
9
|
-
return NackError.fromEntity(fromDTONack(value));
|
|
10
|
-
}
|
|
11
|
-
const nested = value === null || value === void 0 ? void 0 : value.data;
|
|
12
|
-
if (isNackDTO(nested)) {
|
|
13
|
-
return NackError.fromEntity(fromDTONack(nested));
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
};
|
|
17
6
|
/**
|
|
18
7
|
* Set error action.
|
|
19
8
|
* @remarks
|
|
@@ -21,10 +10,9 @@ const nackErrorFrom = (value) => {
|
|
|
21
10
|
* @public
|
|
22
11
|
*/
|
|
23
12
|
export const setError = assign(({ event }) => {
|
|
24
|
-
var _a;
|
|
25
13
|
if (isErrorEvent(event)) {
|
|
26
14
|
return {
|
|
27
|
-
error:
|
|
15
|
+
error: event.data,
|
|
28
16
|
};
|
|
29
17
|
}
|
|
30
18
|
if (is200Nack(event)) {
|
|
@@ -33,12 +21,4 @@ export const setError = assign(({ event }) => {
|
|
|
33
21
|
error: NackError.fromEntity(event.output),
|
|
34
22
|
};
|
|
35
23
|
}
|
|
36
|
-
if (isDoneInvokeEvent(event)) {
|
|
37
|
-
const nackError = nackErrorFrom(event.output);
|
|
38
|
-
if (nackError) {
|
|
39
|
-
return {
|
|
40
|
-
error: nackError,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
24
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter, __decorate, __param } from "tslib";
|
|
2
2
|
import { AbstractMachine, createErrorStateNode, FetchMachine, isDoneInvokeEvent, isErrorEvent, isEventWithParams, isUnauthorizedError, } from '@genesislcap/foundation-state-machine';
|
|
3
3
|
import { User } from '@genesislcap/foundation-user';
|
|
4
|
-
import { UUID, LOGIN_DETAILS_URL, LOGIN_URL, ACCEPT_TERMS_URL, LOGOUT_URL, FORGOT_PASSWORD_URL, CHANGE_PASSWORD_URL, RESET_PASSWORD_URL,
|
|
4
|
+
import { UUID, LOGIN_DETAILS_URL, LOGIN_URL, ACCEPT_TERMS_URL, LOGOUT_URL, FORGOT_PASSWORD_URL, CHANGE_PASSWORD_URL, RESET_PASSWORD_URL, } from '@genesislcap/foundation-utils';
|
|
5
5
|
import { DI } from '@microsoft/fast-foundation';
|
|
6
6
|
import { and, assign, createMachine, fromPromise, not, or, raise, sendTo } from 'xstate';
|
|
7
7
|
import { AuthConfig } from '../config/config';
|
|
@@ -122,17 +122,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
122
122
|
invoke: {
|
|
123
123
|
id: 'loginDetailsFetcher',
|
|
124
124
|
src: fetchMachine.machine,
|
|
125
|
-
onDone:
|
|
126
|
-
{
|
|
127
|
-
guard: 'isUnauthorizedError',
|
|
128
|
-
target: 'loggedOut',
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
guard: 'isFetchError',
|
|
132
|
-
target: 'error.silentLogin',
|
|
133
|
-
},
|
|
134
|
-
this.dtoTransition(),
|
|
135
|
-
],
|
|
125
|
+
onDone: this.dtoTransition(),
|
|
136
126
|
onError: [
|
|
137
127
|
{
|
|
138
128
|
guard: 'isUnauthorizedError',
|
|
@@ -156,13 +146,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
156
146
|
invoke: {
|
|
157
147
|
id: 'loginFetcher',
|
|
158
148
|
src: fetchMachine.machine,
|
|
159
|
-
onDone:
|
|
160
|
-
{
|
|
161
|
-
guard: 'isFetchError',
|
|
162
|
-
target: 'error.login',
|
|
163
|
-
},
|
|
164
|
-
this.dtoTransition(),
|
|
165
|
-
],
|
|
149
|
+
onDone: this.dtoTransition(),
|
|
166
150
|
onError: 'error.login',
|
|
167
151
|
},
|
|
168
152
|
entry: [
|
|
@@ -221,13 +205,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
221
205
|
invoke: {
|
|
222
206
|
id: 'logoutFetcher',
|
|
223
207
|
src: fetchMachine.machine,
|
|
224
|
-
onDone:
|
|
225
|
-
{
|
|
226
|
-
guard: 'isFetchError',
|
|
227
|
-
target: 'error.logout',
|
|
228
|
-
},
|
|
229
|
-
this.dtoTransition(),
|
|
230
|
-
],
|
|
208
|
+
onDone: this.dtoTransition(),
|
|
231
209
|
onError: 'error.logout',
|
|
232
210
|
},
|
|
233
211
|
entry: [
|
|
@@ -258,19 +236,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
258
236
|
invoke: {
|
|
259
237
|
id: 'forgotPasswordFetcher',
|
|
260
238
|
src: fetchMachine.machine,
|
|
261
|
-
onDone:
|
|
262
|
-
{
|
|
263
|
-
guard: 'isFetchError',
|
|
264
|
-
target: 'error.forgotPassword',
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
/**
|
|
268
|
-
* HTTP 200 NACKs are treated as success on purpose so the UI cannot
|
|
269
|
-
* reveal whether an account exists (account enumeration).
|
|
270
|
-
*/
|
|
271
|
-
target: 'feedback.forgotPassword',
|
|
272
|
-
},
|
|
273
|
-
],
|
|
239
|
+
onDone: 'feedback.forgotPassword',
|
|
274
240
|
onError: 'error.forgotPassword',
|
|
275
241
|
},
|
|
276
242
|
entry: [
|
|
@@ -291,10 +257,6 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
291
257
|
id: 'changePasswordFetcher',
|
|
292
258
|
src: fetchMachine.machine,
|
|
293
259
|
onDone: [
|
|
294
|
-
{
|
|
295
|
-
guard: 'isFetchError',
|
|
296
|
-
target: 'error.changePassword',
|
|
297
|
-
},
|
|
298
260
|
{
|
|
299
261
|
guard: 'is200NackDTO',
|
|
300
262
|
target: 'error.changePassword',
|
|
@@ -332,29 +294,19 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
332
294
|
invoke: {
|
|
333
295
|
id: 'resetPasswordFetcher',
|
|
334
296
|
src: fetchMachine.machine,
|
|
335
|
-
onDone:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this.cm.storeCredentials({
|
|
349
|
-
id: params.username,
|
|
350
|
-
name: params.username,
|
|
351
|
-
password: params.newPassword,
|
|
352
|
-
});
|
|
353
|
-
},
|
|
354
|
-
],
|
|
355
|
-
target: 'feedback.resetPassword',
|
|
356
|
-
},
|
|
357
|
-
],
|
|
297
|
+
onDone: {
|
|
298
|
+
actions: [
|
|
299
|
+
({ context }) => {
|
|
300
|
+
const params = context.params;
|
|
301
|
+
this.cm.storeCredentials({
|
|
302
|
+
id: params.username,
|
|
303
|
+
name: params.username,
|
|
304
|
+
password: params.newPassword,
|
|
305
|
+
});
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
target: 'feedback.resetPassword',
|
|
309
|
+
},
|
|
358
310
|
onError: 'error.resetPassword',
|
|
359
311
|
},
|
|
360
312
|
entry: [
|
|
@@ -377,17 +329,11 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
377
329
|
invoke: {
|
|
378
330
|
id: 'acceptTermsFetcher',
|
|
379
331
|
src: fetchMachine.machine,
|
|
380
|
-
onDone:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
{
|
|
386
|
-
actions: ['refreshLogin'],
|
|
387
|
-
target: '#authMachine.idle',
|
|
388
|
-
},
|
|
389
|
-
],
|
|
390
|
-
onError: '#authMachine.error.acceptTerms',
|
|
332
|
+
onDone: {
|
|
333
|
+
actions: ['refreshLogin'],
|
|
334
|
+
target: '#authMachine.idle',
|
|
335
|
+
},
|
|
336
|
+
onError: '#authMachine.idle',
|
|
391
337
|
},
|
|
392
338
|
entry: [
|
|
393
339
|
sendTo('acceptTermsFetcher', ({ context }) => {
|
|
@@ -519,7 +465,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
519
465
|
},
|
|
520
466
|
after: {
|
|
521
467
|
feedbackDelay: {
|
|
522
|
-
actions:
|
|
468
|
+
actions: 'loginRedirect',
|
|
523
469
|
target: '#authMachine.idle',
|
|
524
470
|
},
|
|
525
471
|
},
|
|
@@ -530,10 +476,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
530
476
|
content: 'MESSAGE_FORGOT_PASSWORD_RESET',
|
|
531
477
|
},
|
|
532
478
|
after: {
|
|
533
|
-
feedbackDelay:
|
|
534
|
-
actions: 'clearErrors',
|
|
535
|
-
target: '#authMachine.idle',
|
|
536
|
-
},
|
|
479
|
+
feedbackDelay: '#authMachine.idle',
|
|
537
480
|
},
|
|
538
481
|
},
|
|
539
482
|
resetPassword: {
|
|
@@ -543,7 +486,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
543
486
|
},
|
|
544
487
|
after: {
|
|
545
488
|
feedbackDelay: {
|
|
546
|
-
actions:
|
|
489
|
+
actions: 'loginRedirect',
|
|
547
490
|
target: '#authMachine.idle',
|
|
548
491
|
},
|
|
549
492
|
},
|
|
@@ -609,7 +552,6 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
609
552
|
changePassword: createErrorStateNode('change-password', 'ERROR_CHANGE_PASSWORD'),
|
|
610
553
|
forgotPassword: createErrorStateNode('forgot-password', 'ERROR_FORGOT_PASSWORD'),
|
|
611
554
|
resetPassword: createErrorStateNode('reset-password', 'ERROR_RESET_PASSWORD'),
|
|
612
|
-
acceptTerms: createErrorStateNode('accept-terms', 'ERROR_ACCEPT_TERMS'),
|
|
613
555
|
logout: createErrorStateNode('logout', 'ERROR_LOGOUT_ERROR'),
|
|
614
556
|
mapping: createErrorStateNode('mapping', 'ERROR_MAPPING'),
|
|
615
557
|
},
|
|
@@ -674,11 +616,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
674
616
|
}
|
|
675
617
|
},
|
|
676
618
|
setError,
|
|
677
|
-
|
|
678
|
-
error: undefined,
|
|
679
|
-
errors: createErrorMap(logger.error),
|
|
680
|
-
})),
|
|
681
|
-
resetContext: assign(() => (Object.assign(Object.assign({}, this.startingContext), { errors: createErrorMap(logger.error), error: undefined }))),
|
|
619
|
+
resetContext: assign(() => this.startingContext),
|
|
682
620
|
preventSilentAccess: () => __awaiter(this, void 0, void 0, function* () {
|
|
683
621
|
yield this.cm.preventSilentAccess();
|
|
684
622
|
}),
|
|
@@ -714,13 +652,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
714
652
|
hasSSOToken: ({ context }) => isQueryParams(context.params) && context.params.SSO_TOKEN !== undefined,
|
|
715
653
|
hasMFACode: ({ context }) => isQueryParams(context.params) && context.params.MFA_CODE !== undefined,
|
|
716
654
|
hasWindowOpener: () => window.opener,
|
|
717
|
-
isUnauthorizedError: ({ event }) =>
|
|
718
|
-
if (isErrorEvent(event)) {
|
|
719
|
-
return isUnauthorizedError(event.data);
|
|
720
|
-
}
|
|
721
|
-
return isDoneInvokeEvent(event) ? isUnauthorizedError(event.output) : false;
|
|
722
|
-
},
|
|
723
|
-
isFetchError: ({ event }) => isDoneInvokeEvent(event) ? event.output instanceof Error : false,
|
|
655
|
+
isUnauthorizedError: ({ event }) => isErrorEvent(event) ? isUnauthorizedError(event.data) : false,
|
|
724
656
|
isAuthenticated: ({ context }) => { var _a; return (_a = context.user) === null || _a === void 0 ? void 0 : _a.isAuthenticated; },
|
|
725
657
|
isBanned: ({ context }) => { var _a; return (_a = context.user) === null || _a === void 0 ? void 0 : _a.isBanned(); },
|
|
726
658
|
isLoginAckEntity: ({ event }) => isDoneInvokeEvent(event) ? isLoginAckEntity(event.output) : false,
|
package/dist/esm/mapper/utils.js
CHANGED
|
@@ -42,14 +42,9 @@ const getNormalisedStatusCode = (arr) => {
|
|
|
42
42
|
* getNormalisedText
|
|
43
43
|
* @param arr - A NackErrorWarning array.
|
|
44
44
|
* @returns A combined text string.
|
|
45
|
-
* @remarks
|
|
46
|
-
* Joins message texts with `\n` deliberately so multi-error NACKs render as separate
|
|
47
|
-
* lines under `white-space: pre-line` (e.g. auth MessageElement). Consumers that
|
|
48
|
-
* surface `NackError.message` without a pre-line renderer (toasts, etc.) will see a
|
|
49
|
-
* literal newline where a space was used historically.
|
|
50
45
|
* @internal
|
|
51
46
|
*/
|
|
52
|
-
export const getNormalisedText = (arr) => Array.isArray(arr) && arr.length ? arr.map((msg) => msg.text).join('
|
|
47
|
+
export const getNormalisedText = (arr) => Array.isArray(arr) && arr.length ? arr.map((msg) => msg.text).join(' ') : undefined;
|
|
53
48
|
/**
|
|
54
49
|
* hasDTOErrorWarningCode
|
|
55
50
|
* @remarks
|
package/dist/esm/routes/base.js
CHANGED
|
@@ -372,7 +372,7 @@ let MessageElement = class MessageElement extends FASTElement {
|
|
|
372
372
|
const translateHelper = (metaMessage) => this.i18next.t(`${defaultAuthConfig.name}:${metaMessage}`, { lng: this.i18next.language });
|
|
373
373
|
const meta = this.store.metaMessages.map(translateHelper).join('\n');
|
|
374
374
|
const error = this.store.errorMessages.map(translateHelper).join('\n');
|
|
375
|
-
return error ? `${meta}
|
|
375
|
+
return !error ? meta : `${meta} ${error}.`;
|
|
376
376
|
}
|
|
377
377
|
get hasError() {
|
|
378
378
|
return this.store.errorMessages.length > 0;
|
|
@@ -24,17 +24,8 @@ let ResetPassword = class ResetPassword extends BaseRoute {
|
|
|
24
24
|
this.passwordResetToken = '';
|
|
25
25
|
}
|
|
26
26
|
enter(phase) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.hasPasswordExpired = !!query.expired;
|
|
30
|
-
this.passwordResetToken = (_b = query.password) !== null && _b !== void 0 ? _b : '';
|
|
31
|
-
if (!this.hasPasswordExpired) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const username = (_d = (_c = this.store.authMachine.context.params) === null || _c === void 0 ? void 0 : _c.username) === null || _d === void 0 ? void 0 : _d.trim();
|
|
35
|
-
if (username) {
|
|
36
|
-
this.$emit('auth-username-changed', username);
|
|
37
|
-
}
|
|
27
|
+
this.hasPasswordExpired = !!phase.route.queryParams.expired;
|
|
28
|
+
this.passwordResetToken = phase.route.queryParams.password;
|
|
38
29
|
}
|
|
39
30
|
onSubmit() {
|
|
40
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"FIELD_PASSWORD_REPEAT_NEW_TITLE": "Repeat New Password",
|
|
44
44
|
"MESSAGE_PASSWORD_CHANGE_SUCCESS": "Password change success.",
|
|
45
45
|
"MESSAGE_FORGOT_PASSWORD_RESET": "Please check your inbox for reset instructions.",
|
|
46
|
-
"MESSAGE_PASSWORD_RESET_SUCCESS": "Password reset success.
|
|
46
|
+
"MESSAGE_PASSWORD_RESET_SUCCESS": "Password reset success.",
|
|
47
47
|
"MESSAGE_INCORRECT_CREDENTIALS": "Incorrect credentials, please try again.",
|
|
48
48
|
"MESSAGE_MFA_REQUIRED": "Please check your inbox for your login link.",
|
|
49
49
|
"MESSAGE_PASSWORD_EXPIRED": "You are required to change your password.",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"ERROR_PASSWORD_MISMATCH": "New password and confirmation must match.",
|
|
55
55
|
"ERROR_FORGOT_PASSWORD": "Forgot password error.",
|
|
56
56
|
"ERROR_RESET_PASSWORD": "Reset password error.",
|
|
57
|
-
"ERROR_ACCEPT_TERMS": "Accept terms error.",
|
|
58
57
|
"ERROR_LOGOUT_ERROR": "Logout error.",
|
|
59
58
|
"ERROR_MAPPING": "Mapping error."
|
|
60
59
|
}
|
|
@@ -1935,11 +1935,6 @@ export declare type GetCredentialOptions = CredentialRequestOptions & {};
|
|
|
1935
1935
|
* getNormalisedText
|
|
1936
1936
|
* @param arr - A NackErrorWarning array.
|
|
1937
1937
|
* @returns A combined text string.
|
|
1938
|
-
* @remarks
|
|
1939
|
-
* Joins message texts with `\n` deliberately so multi-error NACKs render as separate
|
|
1940
|
-
* lines under `white-space: pre-line` (e.g. auth MessageElement). Consumers that
|
|
1941
|
-
* surface `NackError.message` without a pre-line renderer (toasts, etc.) will see a
|
|
1942
|
-
* literal newline where a space was used historically.
|
|
1943
1938
|
* @internal
|
|
1944
1939
|
*/
|
|
1945
1940
|
export declare const getNormalisedText: (arr: NackErrorWarning[]) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-auth",
|
|
3
3
|
"description": "Genesis Foundation Auth",
|
|
4
|
-
"version": "15.24.0
|
|
4
|
+
"version": "15.24.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-auth.d.ts",
|
|
@@ -134,25 +134,25 @@
|
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@genesislcap/foundation-testing": "15.24.0
|
|
138
|
-
"@genesislcap/genx": "15.24.0
|
|
139
|
-
"@genesislcap/rollup-builder": "15.24.0
|
|
140
|
-
"@genesislcap/ts-builder": "15.24.0
|
|
141
|
-
"@genesislcap/uvu-playwright-builder": "15.24.0
|
|
142
|
-
"@genesislcap/vite-builder": "15.24.0
|
|
143
|
-
"@genesislcap/webpack-builder": "15.24.0
|
|
137
|
+
"@genesislcap/foundation-testing": "15.24.0",
|
|
138
|
+
"@genesislcap/genx": "15.24.0",
|
|
139
|
+
"@genesislcap/rollup-builder": "15.24.0",
|
|
140
|
+
"@genesislcap/ts-builder": "15.24.0",
|
|
141
|
+
"@genesislcap/uvu-playwright-builder": "15.24.0",
|
|
142
|
+
"@genesislcap/vite-builder": "15.24.0",
|
|
143
|
+
"@genesislcap/webpack-builder": "15.24.0"
|
|
144
144
|
},
|
|
145
145
|
"dependencies": {
|
|
146
|
-
"@genesislcap/foundation-comms": "15.24.0
|
|
147
|
-
"@genesislcap/foundation-events": "15.24.0
|
|
148
|
-
"@genesislcap/foundation-i18n": "15.24.0
|
|
149
|
-
"@genesislcap/foundation-logger": "15.24.0
|
|
150
|
-
"@genesislcap/foundation-state-machine": "15.24.0
|
|
151
|
-
"@genesislcap/foundation-store": "15.24.0
|
|
152
|
-
"@genesislcap/foundation-ui": "15.24.0
|
|
153
|
-
"@genesislcap/foundation-user": "15.24.0
|
|
154
|
-
"@genesislcap/foundation-utils": "15.24.0
|
|
155
|
-
"@genesislcap/foundation-zero": "15.24.0
|
|
146
|
+
"@genesislcap/foundation-comms": "15.24.0",
|
|
147
|
+
"@genesislcap/foundation-events": "15.24.0",
|
|
148
|
+
"@genesislcap/foundation-i18n": "15.24.0",
|
|
149
|
+
"@genesislcap/foundation-logger": "15.24.0",
|
|
150
|
+
"@genesislcap/foundation-state-machine": "15.24.0",
|
|
151
|
+
"@genesislcap/foundation-store": "15.24.0",
|
|
152
|
+
"@genesislcap/foundation-ui": "15.24.0",
|
|
153
|
+
"@genesislcap/foundation-user": "15.24.0",
|
|
154
|
+
"@genesislcap/foundation-utils": "15.24.0",
|
|
155
|
+
"@genesislcap/foundation-zero": "15.24.0",
|
|
156
156
|
"@microsoft/fast-components": "2.30.6",
|
|
157
157
|
"@microsoft/fast-element": "1.14.0",
|
|
158
158
|
"@microsoft/fast-foundation": "2.50.0",
|