@genesislcap/foundation-auth 15.14.2-FUI-2603.1 → 15.14.2-FUI-2603.3
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 +0 -13
- package/dist/dts/machine/actions.d.ts.map +1 -1
- package/dist/dts/machine/errors.d.ts +0 -5
- package/dist/dts/machine/errors.d.ts.map +1 -1
- package/dist/dts/machine/guards.d.ts +1 -2
- package/dist/dts/machine/guards.d.ts.map +1 -1
- package/dist/dts/machine/machine.d.ts +0 -4
- package/dist/dts/machine/machine.d.ts.map +1 -1
- package/dist/dts/machine/types.d.ts +0 -2
- package/dist/dts/machine/types.d.ts.map +1 -1
- package/dist/dts/mapper/utils.d.ts +0 -11
- package/dist/dts/mapper/utils.d.ts.map +1 -1
- package/dist/dts/routes/base.d.ts +0 -1
- package/dist/dts/routes/base.d.ts.map +1 -1
- package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -1
- package/dist/dts/routes/reset-password/reset-password.d.ts +0 -2
- package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
- package/dist/dts/routes/reset-password/reset-password.template.d.ts.map +1 -1
- package/dist/esm/machine/actions.js +14 -16
- package/dist/esm/machine/errors.js +8 -39
- package/dist/esm/machine/guards.js +5 -13
- package/dist/esm/machine/machine.js +18 -28
- package/dist/esm/mapper/utils.js +0 -16
- package/dist/esm/routes/base.js +0 -6
- package/dist/esm/routes/forgot-password/forgot-password.js +0 -5
- package/dist/esm/routes/reset-password/reset-password.js +13 -19
- package/dist/esm/routes/reset-password/reset-password.template.js +2 -6
- package/dist/esm/translation.json +1 -2
- package/dist/foundation-auth.api.json +2 -175
- package/dist/foundation-auth.d.ts +1 -35
- package/package.json +19 -19
- package/dist/dts/machine/actions.test.d.ts +0 -2
- package/dist/dts/machine/actions.test.d.ts.map +0 -1
- package/dist/dts/machine/guards.test.d.ts +0 -2
- package/dist/dts/machine/guards.test.d.ts.map +0 -1
- package/dist/dts/mapper/utils.test.d.ts +0 -2
- package/dist/dts/mapper/utils.test.d.ts.map +0 -1
- package/dist/dts/routes/reset-password/reset-identity.d.ts +0 -38
- package/dist/dts/routes/reset-password/reset-identity.d.ts.map +0 -1
- package/dist/dts/routes/reset-password/reset-identity.test.d.ts +0 -2
- package/dist/dts/routes/reset-password/reset-identity.test.d.ts.map +0 -1
- package/dist/esm/machine/actions.test.js +0 -21
- package/dist/esm/machine/guards.test.js +0 -53
- package/dist/esm/mapper/utils.test.js +0 -56
- package/dist/esm/routes/reset-password/reset-identity.js +0 -99
- package/dist/esm/routes/reset-password/reset-identity.test.js +0 -55
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
type ErrorState = {
|
|
2
|
-
error?: unknown;
|
|
3
|
-
errors?: {
|
|
4
|
-
clear(): void;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so
|
|
9
|
-
* reset must clear it in place rather than replacing the context object.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare function clearAuthErrorState<T extends ErrorState>(context: T, starting?: T): T;
|
|
13
1
|
/**
|
|
14
2
|
* Set error action.
|
|
15
3
|
* @remarks
|
|
@@ -24,5 +12,4 @@ export declare const setError: {
|
|
|
24
12
|
assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
|
|
25
13
|
}) => import("xstate").AnyState[];
|
|
26
14
|
};
|
|
27
|
-
export {};
|
|
28
15
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -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":"AAQA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAkBnB,CAAC"}
|
|
@@ -23,9 +23,4 @@ export declare class NackError extends APIError {
|
|
|
23
23
|
*/
|
|
24
24
|
static fromEntity(entity: Nack): NackError | null;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Build a {@link NackError} from a fetch/API/NACK payload.
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
export declare function nackErrorFromUnknown(value: unknown): NackError | null;
|
|
31
26
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/machine/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/machine/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,QAAQ;IAE5B,MAAM,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,OAAO;gBADd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,OAAO,EACrB,OAAO,GAAE,MAA6B;IAKxC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI;CAmBlD"}
|
|
@@ -2,8 +2,7 @@ import { DoneInvokeEvent, EventObject } from 'xstate';
|
|
|
2
2
|
/**
|
|
3
3
|
* is200Nack.
|
|
4
4
|
* @privateRemarks
|
|
5
|
-
* Required until http status codes are aligned on backend.
|
|
6
|
-
* Genesis MESSAGE_TYPE / ERROR determine failure.
|
|
5
|
+
* Required until http status codes are aligned on backend.
|
|
7
6
|
* @public
|
|
8
7
|
*/
|
|
9
8
|
export declare const is200Nack: <TOutput = any>(event: EventObject | DoneInvokeEvent<TOutput>) => event is DoneInvokeEvent<TOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGtD
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGtD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,GAAG,EACrC,OAAO,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,KAC5C,KAAK,IAAI,eAAe,CAAC,OAAO,CAGxB,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,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;
|
|
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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AsB,GAC7B,MAAM,IAAI,oBAAoB,CAGhC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,oBAAoB,CAGhC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,mBAAmB,CAG/B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,WAAW,CAGnF"}
|
|
@@ -44,17 +44,6 @@ export declare const fromIDPDTO: (dto: IDENTITY_PROVIDER) => IdentityProvider;
|
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
46
|
export declare function isNackDTO(dto: unknown): dto is NACK;
|
|
47
|
-
/**
|
|
48
|
-
* True when a Genesis payload contains at least one ERROR item.
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
export declare function hasDTOErrors(dto: unknown): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* True when a Genesis payload must be treated as failure.
|
|
54
|
-
* HTTP status is intentionally ignored; MESSAGE_TYPE and ERROR are the contract.
|
|
55
|
-
* @public
|
|
56
|
-
*/
|
|
57
|
-
export declare function isFailedAuthDTO(dto: unknown): boolean;
|
|
58
47
|
/**
|
|
59
48
|
* isNackEntity.
|
|
60
49
|
* @param entity - Potential Nack.
|
|
@@ -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,CAA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GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,SAAS,EAAE,QAAQ,MAAM,2DAgBhE,CAAC;AAyBF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,SAAS,EAChD,MAAM,KAAK,GAAG,cAAc,GAAG,YAAY,2DAkB5C,CAAC;AAoHF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,UAAU,EAAE,SAAS,OAAO,EAAE,OAAO,MAAM,2DAU/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,EAC/C,OAAO,MAAM,EACb,aAAY,MAAiB,EAC7B,WAAU,OAAe,2DAW1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,SAAS,6DAO3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;;;;GAQG;AACH,qBAKa,cAAe,SAAQ,SAAS;IACrC,QAAQ;CAUf"}
|
|
@@ -19,9 +19,7 @@ export declare class ResetPassword extends BaseRoute {
|
|
|
19
19
|
hasPasswordExpired: boolean;
|
|
20
20
|
passwordResetToken: string;
|
|
21
21
|
enter(phase: NavigationPhase<Settings>): void;
|
|
22
|
-
private applyResetIdentity;
|
|
23
22
|
onSubmit(): Promise<void>;
|
|
24
23
|
get headingText(): "Change Password" | "You are required to change your password";
|
|
25
|
-
get showIdentityFields(): boolean;
|
|
26
24
|
}
|
|
27
25
|
//# sourceMappingURL=reset-password.d.ts.map
|
|
@@ -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;
|
|
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;IAsBhC,QAAQ;IAwBd,IACI,WAAW,mEAEd;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAUA,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":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,oEAoCjC,CAAC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isErrorEvent } from '@genesislcap/foundation-state-machine';
|
|
2
2
|
import { assign } from 'xstate';
|
|
3
|
+
import { fromDTONack, isNackDTO } from '../mapper';
|
|
3
4
|
import { logger } from '../utils';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
* Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so
|
|
7
|
-
* reset must clear it in place rather than replacing the context object.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export function clearAuthErrorState(context, starting) {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
(_a = context.errors) === null || _a === void 0 ? void 0 : _a.clear();
|
|
13
|
-
return Object.assign(Object.assign({}, (starting !== null && starting !== void 0 ? starting : context)), { error: undefined, errors: (_b = context.errors) !== null && _b !== void 0 ? _b : starting === null || starting === void 0 ? void 0 : starting.errors });
|
|
14
|
-
}
|
|
5
|
+
import { NackError } from './errors';
|
|
6
|
+
import { is200Nack } from './guards';
|
|
15
7
|
/**
|
|
16
8
|
* Set error action.
|
|
17
9
|
* @remarks
|
|
@@ -19,16 +11,22 @@ export function clearAuthErrorState(context, starting) {
|
|
|
19
11
|
* @public
|
|
20
12
|
*/
|
|
21
13
|
export const setError = assign(({ event }) => {
|
|
22
|
-
var _a
|
|
14
|
+
var _a;
|
|
23
15
|
if (isErrorEvent(event)) {
|
|
24
16
|
return {
|
|
25
|
-
error:
|
|
17
|
+
error: event.data,
|
|
26
18
|
};
|
|
27
19
|
}
|
|
28
|
-
if (
|
|
20
|
+
if (is200Nack(event)) {
|
|
29
21
|
logger.debug(`setError action called with non error event type.`, event);
|
|
30
22
|
return {
|
|
31
|
-
error: (
|
|
23
|
+
error: NackError.fromEntity(event.output),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const data = (_a = event.output) === null || _a === void 0 ? void 0 : _a.data;
|
|
27
|
+
if (isNackDTO(data)) {
|
|
28
|
+
return {
|
|
29
|
+
error: NackError.fromEntity(fromDTONack(data)),
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
32
|
});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { APIError
|
|
2
|
-
import { StatusCodes } from 'http-status-codes';
|
|
3
|
-
import { fromDTONack, isNackDTO, isNackEntity } from '../mapper/utils';
|
|
1
|
+
import { APIError } from '@genesislcap/foundation-state-machine';
|
|
4
2
|
/**
|
|
5
3
|
* NackError.
|
|
6
4
|
*
|
|
@@ -28,44 +26,15 @@ export class NackError extends APIError {
|
|
|
28
26
|
if (!entity) {
|
|
29
27
|
return null;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Prioritize errors
|
|
31
|
+
*/
|
|
32
|
+
if (entity.normalisedErrorStatusCode > 0) {
|
|
33
|
+
return new NackError(entity.normalisedErrorStatusCode, entity, entity.normalisedErrorText);
|
|
35
34
|
}
|
|
36
|
-
if (entity.
|
|
37
|
-
return new NackError(entity.normalisedWarningStatusCode
|
|
38
|
-
? entity.normalisedWarningStatusCode
|
|
39
|
-
: StatusCodes.BAD_REQUEST, entity, entity.normalisedWarningText);
|
|
35
|
+
if (entity.normalisedWarningStatusCode > 0) {
|
|
36
|
+
return new NackError(entity.normalisedWarningStatusCode, entity, entity.normalisedWarningText);
|
|
40
37
|
}
|
|
41
38
|
return null;
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Build a {@link NackError} from a fetch/API/NACK payload.
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export function nackErrorFromUnknown(value) {
|
|
49
|
-
if (value == null) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
if (value instanceof NackError) {
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
55
|
-
if (isAPIError(value)) {
|
|
56
|
-
return nackErrorFromUnknown(value.data);
|
|
57
|
-
}
|
|
58
|
-
if (typeof value === 'object' && value !== null && 'data' in value) {
|
|
59
|
-
const nested = nackErrorFromUnknown(value.data);
|
|
60
|
-
if (nested) {
|
|
61
|
-
return nested;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (isNackDTO(value)) {
|
|
65
|
-
return NackError.fromEntity(fromDTONack(value));
|
|
66
|
-
}
|
|
67
|
-
if (isNackEntity(value)) {
|
|
68
|
-
return NackError.fromEntity(value);
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { isDoneInvokeEvent } from '@genesislcap/foundation-state-machine';
|
|
2
|
-
import {
|
|
2
|
+
import { isNackDTO, isNackEntity } from '../mapper';
|
|
3
3
|
/**
|
|
4
4
|
* is200Nack.
|
|
5
5
|
* @privateRemarks
|
|
6
|
-
* Required until http status codes are aligned on backend.
|
|
7
|
-
* Genesis MESSAGE_TYPE / ERROR determine failure.
|
|
6
|
+
* Required until http status codes are aligned on backend.
|
|
8
7
|
* @public
|
|
9
8
|
*/
|
|
10
|
-
export const is200Nack = (event) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
const output = event.output;
|
|
15
|
-
return (isNackEntity(output) ||
|
|
16
|
-
isNackDTO(output) ||
|
|
17
|
-
isFailedAuthDTO(output === null || output === void 0 ? void 0 : output.data) ||
|
|
18
|
-
isNackEntity(output === null || output === void 0 ? void 0 : output.data));
|
|
19
|
-
};
|
|
9
|
+
export const is200Nack = (event) => isDoneInvokeEvent(event)
|
|
10
|
+
? isNackEntity(event.output) || isNackDTO(event.output)
|
|
11
|
+
: false;
|
|
@@ -7,11 +7,10 @@ import { and, assign, createMachine, fromPromise, not, or, raise, sendTo } from
|
|
|
7
7
|
import { AuthConfig } from '../config/config';
|
|
8
8
|
import { CredentialManager, CredentialType, } from '../credential';
|
|
9
9
|
import { MESSAGE_TYPE } from '../dto';
|
|
10
|
-
import { AuthMessageMapper, createHTTPHeadersFromDTO, isLoginAckEntity, isLoginDetailsAckEntity, isLoginNackEntity, isLogoutAckEntity, isLogoutNackEntity,
|
|
11
|
-
import { clearResetIdentity } from '../routes/reset-password/reset-identity';
|
|
10
|
+
import { AuthMessageMapper, createHTTPHeadersFromDTO, isLoginAckEntity, isLoginDetailsAckEntity, isLoginNackEntity, isLogoutAckEntity, isLogoutNackEntity, isNackDTO, } from '../mapper';
|
|
12
11
|
import { AuthRouting } from '../routes/routing';
|
|
13
12
|
import { logger } from '../utils';
|
|
14
|
-
import {
|
|
13
|
+
import { setError } from './actions';
|
|
15
14
|
import { defaultAuthMachineContext, isLoginParams, isQueryParams } from './types';
|
|
16
15
|
/**
|
|
17
16
|
* Default AuthMachine.
|
|
@@ -50,10 +49,6 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
50
49
|
actions,
|
|
51
50
|
target: '#authMachine.resetPassword',
|
|
52
51
|
},
|
|
53
|
-
dismiss: {
|
|
54
|
-
actions: ['resetContext'],
|
|
55
|
-
target: '#authMachine.idle',
|
|
56
|
-
},
|
|
57
52
|
};
|
|
58
53
|
};
|
|
59
54
|
this.dtoTransition = () => ({
|
|
@@ -241,15 +236,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
241
236
|
invoke: {
|
|
242
237
|
id: 'forgotPasswordFetcher',
|
|
243
238
|
src: fetchMachine.machine,
|
|
244
|
-
onDone:
|
|
245
|
-
{
|
|
246
|
-
guard: 'is200NackDTO',
|
|
247
|
-
target: 'error.forgotPassword',
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
target: 'feedback.forgotPassword',
|
|
251
|
-
},
|
|
252
|
-
],
|
|
239
|
+
onDone: 'feedback.forgotPassword',
|
|
253
240
|
onError: 'error.forgotPassword',
|
|
254
241
|
},
|
|
255
242
|
entry: [
|
|
@@ -322,7 +309,6 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
322
309
|
password: params.newPassword,
|
|
323
310
|
});
|
|
324
311
|
},
|
|
325
|
-
() => clearResetIdentity(),
|
|
326
312
|
],
|
|
327
313
|
target: 'feedback.resetPassword',
|
|
328
314
|
},
|
|
@@ -474,12 +460,6 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
474
460
|
*/
|
|
475
461
|
feedback: {
|
|
476
462
|
initial: 'none',
|
|
477
|
-
on: {
|
|
478
|
-
dismiss: {
|
|
479
|
-
actions: ['resetContext'],
|
|
480
|
-
target: '#authMachine.idle',
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
463
|
states: {
|
|
484
464
|
none: {
|
|
485
465
|
tags: ['feedback', 'none'],
|
|
@@ -512,7 +492,14 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
512
492
|
},
|
|
513
493
|
after: {
|
|
514
494
|
feedbackDelay: {
|
|
515
|
-
actions:
|
|
495
|
+
actions: [
|
|
496
|
+
assign(({ context }) => {
|
|
497
|
+
var _a;
|
|
498
|
+
(_a = context.errors) === null || _a === void 0 ? void 0 : _a.clear();
|
|
499
|
+
return { error: undefined };
|
|
500
|
+
}),
|
|
501
|
+
'loginRedirect',
|
|
502
|
+
],
|
|
516
503
|
target: '#authMachine.idle',
|
|
517
504
|
},
|
|
518
505
|
},
|
|
@@ -642,7 +629,11 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
642
629
|
}
|
|
643
630
|
},
|
|
644
631
|
setError,
|
|
645
|
-
resetContext: assign(({ context }) =>
|
|
632
|
+
resetContext: assign(({ context }) => {
|
|
633
|
+
var _a;
|
|
634
|
+
(_a = context.errors) === null || _a === void 0 ? void 0 : _a.clear();
|
|
635
|
+
return Object.assign(Object.assign({}, this.startingContext), { errors: context.errors, error: undefined });
|
|
636
|
+
}),
|
|
646
637
|
preventSilentAccess: () => __awaiter(this, void 0, void 0, function* () {
|
|
647
638
|
yield this.cm.preventSilentAccess();
|
|
648
639
|
}),
|
|
@@ -701,12 +692,11 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
701
692
|
isLogoutNackEntity: ({ event }) => isDoneInvokeEvent(event) ? isLogoutNackEntity(event.output) : false,
|
|
702
693
|
/**
|
|
703
694
|
* Required until strict http status codes are enabled on the backend by default.
|
|
704
|
-
* Treats EVENT_NACK / ERROR payloads as failure regardless of HTTP status.
|
|
705
695
|
*/
|
|
706
696
|
is200NackDTO: ({ event }) => {
|
|
707
|
-
var _a;
|
|
697
|
+
var _a, _b;
|
|
708
698
|
return isDoneInvokeEvent(event)
|
|
709
|
-
?
|
|
699
|
+
? ((_b = (_a = event.output) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.ok) && isNackDTO(event.output.data)
|
|
710
700
|
: false;
|
|
711
701
|
},
|
|
712
702
|
},
|
package/dist/esm/mapper/utils.js
CHANGED
|
@@ -107,22 +107,6 @@ export function isNackDTO(dto) {
|
|
|
107
107
|
var _a;
|
|
108
108
|
return (_a = dto === null || dto === void 0 ? void 0 : dto.MESSAGE_TYPE) === null || _a === void 0 ? void 0 : _a.endsWith('_NACK');
|
|
109
109
|
}
|
|
110
|
-
/**
|
|
111
|
-
* True when a Genesis payload contains at least one ERROR item.
|
|
112
|
-
* @public
|
|
113
|
-
*/
|
|
114
|
-
export function hasDTOErrors(dto) {
|
|
115
|
-
const errors = dto === null || dto === void 0 ? void 0 : dto.ERROR;
|
|
116
|
-
return Array.isArray(errors) && errors.length > 0;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* True when a Genesis payload must be treated as failure.
|
|
120
|
-
* HTTP status is intentionally ignored; MESSAGE_TYPE and ERROR are the contract.
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
123
|
-
export function isFailedAuthDTO(dto) {
|
|
124
|
-
return isNackDTO(dto) || hasDTOErrors(dto);
|
|
125
|
-
}
|
|
126
110
|
/**
|
|
127
111
|
* isNackEntity.
|
|
128
112
|
* @param entity - Potential Nack.
|
package/dist/esm/routes/base.js
CHANGED
|
@@ -53,12 +53,6 @@ export class BaseRoute extends ConfigHostElement {
|
|
|
53
53
|
super(...arguments);
|
|
54
54
|
this.onBack = () => this.routing.navigateTo('/');
|
|
55
55
|
}
|
|
56
|
-
connectedCallback() {
|
|
57
|
-
var _a, _b, _c, _d, _e;
|
|
58
|
-
super.connectedCallback();
|
|
59
|
-
(_c = (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.formEntry) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c.clear();
|
|
60
|
-
(_e = (_d = this.store) === null || _d === void 0 ? void 0 : _d.authMachine) === null || _e === void 0 ? void 0 : _e.send({ type: 'dismiss' });
|
|
61
|
-
}
|
|
62
56
|
toLocalisedText(text) {
|
|
63
57
|
return this.i18next.t(`${defaultAuthConfig.name}:${text}`, { lng: this.i18next.language });
|
|
64
58
|
}
|
|
@@ -3,7 +3,6 @@ import { customElement } from '@microsoft/fast-element';
|
|
|
3
3
|
import { commonStyles } from '../../styles';
|
|
4
4
|
import { logger } from '../../utils';
|
|
5
5
|
import { BaseRoute } from '../base';
|
|
6
|
-
import { persistResetIdentity } from '../reset-password/reset-identity';
|
|
7
6
|
import { ForgotPasswordTemplate as template } from './forgot-password.template';
|
|
8
7
|
/**
|
|
9
8
|
* ForgotPassword
|
|
@@ -21,10 +20,6 @@ let ForgotPassword = class ForgotPassword extends BaseRoute {
|
|
|
21
20
|
/**
|
|
22
21
|
* Example url from email: https://public-foundation.genesislab.global/reset-password?password=nc_cbGrlgCkZeJHAF043oqEidnk
|
|
23
22
|
*/
|
|
24
|
-
persistResetIdentity({
|
|
25
|
-
username: this.store.formEntry.username,
|
|
26
|
-
organisation: this.store.formEntry.organisation,
|
|
27
|
-
});
|
|
28
23
|
this.$emit('auth-forgot-password', {
|
|
29
24
|
username: this.store.formEntry.orgUsername,
|
|
30
25
|
returnUrl: this.routing.getForgotPasswordReturnUrl(),
|
|
@@ -2,7 +2,6 @@ import { __awaiter, __decorate } from "tslib";
|
|
|
2
2
|
import { customElement, observable, volatile } from '@microsoft/fast-element';
|
|
3
3
|
import { commonStyles } from '../../styles';
|
|
4
4
|
import { BaseRoute } from '../base';
|
|
5
|
-
import { readResetIdentity, resolveResetUsername, shouldShowIdentityFields, } from './reset-identity';
|
|
6
5
|
import { ResetPasswordTemplate as template } from './reset-password.template';
|
|
7
6
|
/**
|
|
8
7
|
* ResetPassword
|
|
@@ -25,22 +24,23 @@ let ResetPassword = class ResetPassword extends BaseRoute {
|
|
|
25
24
|
this.passwordResetToken = '';
|
|
26
25
|
}
|
|
27
26
|
enter(phase) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
const query = ((_a = phase.route) === null || _a === void 0 ? void 0 : _a.queryParams) || {};
|
|
29
|
+
this.hasPasswordExpired = !!query.expired;
|
|
30
|
+
this.passwordResetToken = (_b = query.password) !== null && _b !== void 0 ? _b : '';
|
|
31
|
+
if (this.hasPasswordExpired) {
|
|
32
|
+
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();
|
|
33
|
+
if (username) {
|
|
34
|
+
this.$emit('auth-username-changed', username);
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
33
38
|
if (!this.passwordResetToken) {
|
|
34
39
|
return;
|
|
35
40
|
}
|
|
36
|
-
const
|
|
37
|
-
const username = resolveResetUsername(queryParams, stored);
|
|
41
|
+
const username = (query.username || query.user || query.USER_NAME || '').trim();
|
|
38
42
|
if (username) {
|
|
39
|
-
this
|
|
40
|
-
}
|
|
41
|
-
const organisation = queryParams.organisation || (stored === null || stored === void 0 ? void 0 : stored.organisation);
|
|
42
|
-
if (organisation) {
|
|
43
|
-
this.store.formEntry.onOrganisationChanged(new CustomEvent('auth-organisation-changed', { detail: organisation }));
|
|
43
|
+
this.$emit('auth-username-changed', username);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
onSubmit() {
|
|
@@ -69,9 +69,6 @@ let ResetPassword = class ResetPassword extends BaseRoute {
|
|
|
69
69
|
get headingText() {
|
|
70
70
|
return this.hasPasswordExpired ? 'You are required to change your password' : 'Change Password';
|
|
71
71
|
}
|
|
72
|
-
get showIdentityFields() {
|
|
73
|
-
return shouldShowIdentityFields(this.passwordResetToken, this.store.formEntry.username);
|
|
74
|
-
}
|
|
75
72
|
};
|
|
76
73
|
__decorate([
|
|
77
74
|
observable
|
|
@@ -82,9 +79,6 @@ __decorate([
|
|
|
82
79
|
__decorate([
|
|
83
80
|
volatile
|
|
84
81
|
], ResetPassword.prototype, "headingText", null);
|
|
85
|
-
__decorate([
|
|
86
|
-
volatile
|
|
87
|
-
], ResetPassword.prototype, "showIdentityFields", null);
|
|
88
82
|
ResetPassword = __decorate([
|
|
89
83
|
customElement({
|
|
90
84
|
name: 'foundation-auth-reset-password',
|
|
@@ -12,14 +12,10 @@ export const ResetPasswordTemplate = html `
|
|
|
12
12
|
<auth-logo></auth-logo>
|
|
13
13
|
${showEnvironmentIndicator()}
|
|
14
14
|
<div class="heading2" data-test-id="heading">${(x) => x.headingText}</div>
|
|
15
|
-
<div class="heading3">
|
|
16
|
-
${(x) => x.toLocalisedText(x.showIdentityFields ? 'RESET_PASSWORD_SUBTITLE' : 'RESET_PASSWORD_TOKEN_SUBTITLE')}
|
|
17
|
-
</div>
|
|
15
|
+
<div class="heading3">${(x) => x.toLocalisedText('RESET_PASSWORD_SUBTITLE')}</div>
|
|
18
16
|
</div>
|
|
19
17
|
<form @submit=${(x) => x.onSubmit()} autocomplete="on" data-test-id="form">
|
|
20
|
-
${
|
|
21
|
-
${organisationField()} ${usernameField()}
|
|
22
|
-
`)}
|
|
18
|
+
${organisationField()} ${usernameField()}
|
|
23
19
|
${when((x) => !x.passwordResetToken, html `
|
|
24
20
|
${(x) => passwordField(x.toLocalisedText(x.hasPasswordExpired
|
|
25
21
|
? 'RESET_PASSWORD_CURRENT_PASSWORD_FIELD'
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"REQUEST_ACCOUNT_SUBMIT_BUTTON": "Request Account",
|
|
27
27
|
"REQUEST_ACCOUNT_BUTTON_BACK": "Back",
|
|
28
28
|
"RESET_PASSWORD_SUBTITLE": "Enter the username registered to your account",
|
|
29
|
-
"RESET_PASSWORD_TOKEN_SUBTITLE": "Enter a new password for your account",
|
|
30
29
|
"RESET_PASSWORD_OLD_PASSWORD_FIELD": "Old Password",
|
|
31
30
|
"RESET_PASSWORD_CURRENT_PASSWORD_FIELD": "Current Password",
|
|
32
31
|
"RESET_PASSWORD_SUBMIT_BUTTON": "Change Password",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"FIELD_PASSWORD_REPEAT_NEW_TITLE": "Repeat New Password",
|
|
45
44
|
"MESSAGE_PASSWORD_CHANGE_SUCCESS": "Password change success.",
|
|
46
45
|
"MESSAGE_FORGOT_PASSWORD_RESET": "Please check your inbox for reset instructions.",
|
|
47
|
-
"MESSAGE_PASSWORD_RESET_SUCCESS": "Password reset success.",
|
|
46
|
+
"MESSAGE_PASSWORD_RESET_SUCCESS": "Password reset success. Redirecting to login.",
|
|
48
47
|
"MESSAGE_INCORRECT_CREDENTIALS": "Incorrect credentials, please try again.",
|
|
49
48
|
"MESSAGE_MFA_REQUIRED": "Please check your inbox for your login link.",
|
|
50
49
|
"MESSAGE_PASSWORD_EXPIRED": "You are required to change your password.",
|