@genesislcap/foundation-auth 15.14.0 → 15.14.2-FUI-2603.1
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 +13 -0
- package/dist/dts/machine/actions.d.ts.map +1 -1
- package/dist/dts/machine/actions.test.d.ts +2 -0
- package/dist/dts/machine/actions.test.d.ts.map +1 -0
- package/dist/dts/machine/errors.d.ts +5 -0
- package/dist/dts/machine/errors.d.ts.map +1 -1
- package/dist/dts/machine/guards.d.ts +2 -1
- package/dist/dts/machine/guards.d.ts.map +1 -1
- package/dist/dts/machine/guards.test.d.ts +2 -0
- package/dist/dts/machine/guards.test.d.ts.map +1 -0
- package/dist/dts/machine/machine.d.ts +4 -0
- package/dist/dts/machine/machine.d.ts.map +1 -1
- package/dist/dts/machine/types.d.ts +2 -0
- package/dist/dts/machine/types.d.ts.map +1 -1
- package/dist/dts/mapper/utils.d.ts +11 -0
- package/dist/dts/mapper/utils.d.ts.map +1 -1
- package/dist/dts/mapper/utils.test.d.ts +2 -0
- package/dist/dts/mapper/utils.test.d.ts.map +1 -0
- package/dist/dts/routes/base.d.ts +1 -0
- 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-identity.d.ts +38 -0
- package/dist/dts/routes/reset-password/reset-identity.d.ts.map +1 -0
- package/dist/dts/routes/reset-password/reset-identity.test.d.ts +2 -0
- package/dist/dts/routes/reset-password/reset-identity.test.d.ts.map +1 -0
- package/dist/dts/routes/reset-password/reset-password.d.ts +2 -0
- 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 +16 -6
- package/dist/esm/machine/actions.test.js +21 -0
- package/dist/esm/machine/errors.js +39 -8
- package/dist/esm/machine/guards.js +13 -5
- package/dist/esm/machine/guards.test.js +53 -0
- package/dist/esm/machine/machine.js +46 -19
- package/dist/esm/mapper/utils.js +16 -0
- package/dist/esm/mapper/utils.test.js +56 -0
- package/dist/esm/routes/base.js +7 -1
- package/dist/esm/routes/forgot-password/forgot-password.js +5 -0
- package/dist/esm/routes/reset-password/reset-identity.js +99 -0
- package/dist/esm/routes/reset-password/reset-identity.test.js +55 -0
- package/dist/esm/routes/reset-password/reset-password.js +22 -0
- package/dist/esm/routes/reset-password/reset-password.template.js +6 -2
- package/dist/esm/translation.json +1 -0
- package/dist/foundation-auth.api.json +175 -2
- package/dist/foundation-auth.d.ts +35 -1
- package/package.json +19 -19
|
@@ -1,3 +1,15 @@
|
|
|
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;
|
|
1
13
|
/**
|
|
2
14
|
* Set error action.
|
|
3
15
|
* @remarks
|
|
@@ -12,4 +24,5 @@ export declare const setError: {
|
|
|
12
24
|
assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
|
|
13
25
|
}) => import("xstate").AnyState[];
|
|
14
26
|
};
|
|
27
|
+
export {};
|
|
15
28
|
//# 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":"AAKA,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE;QAAE,KAAK,IAAI,IAAI,CAAA;KAAE,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAOrF;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.test.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.test.ts"],"names":[],"mappings":""}
|
|
@@ -23,4 +23,9 @@ 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;
|
|
26
31
|
//# 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,EAAc,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC;;;;;;;;;;;;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;CAwBlD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAuBrE"}
|
|
@@ -2,7 +2,8 @@ import { DoneInvokeEvent, EventObject } from 'xstate';
|
|
|
2
2
|
/**
|
|
3
3
|
* is200Nack.
|
|
4
4
|
* @privateRemarks
|
|
5
|
-
* Required until http status codes are aligned on backend.
|
|
5
|
+
* Required until http status codes are aligned on backend. HTTP status is ignored;
|
|
6
|
+
* Genesis MESSAGE_TYPE / ERROR determine failure.
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
9
|
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;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,GAAG,EACrC,OAAO,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,KAC5C,KAAK,IAAI,eAAe,CAAC,OAAO,CAWlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.test.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.test.ts"],"names":[],"mappings":""}
|
|
@@ -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,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BAAqB,CAAC;CAC/B,GACD,eAAe,CAAC,OAAO,CAAC,GACxB,UAAU,CAAC,OAAO,CAAC,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB,EAAE,gBAAgB,CAAC;CACxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,kBAAkB,CAKjE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,WAAW,CAGnF;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,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,6 +44,17 @@ 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;
|
|
47
58
|
/**
|
|
48
59
|
* isNackEntity.
|
|
49
60
|
* @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,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
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources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0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/mapper/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAKA,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;AAC1E,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,yKAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,UAAU,yKAAkC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,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;AAIpC;;;;;;;;GAQG;AACH,qBAKa,cAAe,SAAQ,SAAS;IACrC,QAAQ;CAcf"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity captured during forgot-password so the token reset screen can
|
|
3
|
+
* submit USER_NAME without asking the user to type it again.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RESET_IDENTITY_STORAGE_KEY = "foundation-auth:password-reset-identity";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type ResetIdentity = {
|
|
10
|
+
username: string;
|
|
11
|
+
organisation?: string;
|
|
12
|
+
};
|
|
13
|
+
type QueryParams = Record<string, string | undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare function persistResetIdentity(identity: ResetIdentity, storage?: Storage): void;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare function readResetIdentity(storage?: Storage): ResetIdentity | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare function clearResetIdentity(storage?: Storage): void;
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveResetUsername(queryParams?: QueryParams, stored?: ResetIdentity): string;
|
|
30
|
+
/**
|
|
31
|
+
* Username is required by EVENT_PASSWORD_RESET_ACTION. Hide it only when a
|
|
32
|
+
* reset token is present and the username is already known.
|
|
33
|
+
*
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function shouldShowIdentityFields(passwordResetToken: string, username: string): boolean;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=reset-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-identity.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-identity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,0BAA0B,4CAA4C,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAatD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAmBrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAqB9E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAU1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,GAAE,WAAgB,EAC7B,MAAM,CAAC,EAAE,aAAa,GACrB,MAAM,CAQR;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE9F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-identity.test.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-identity.test.ts"],"names":[],"mappings":""}
|
|
@@ -19,7 +19,9 @@ export declare class ResetPassword extends BaseRoute {
|
|
|
19
19
|
hasPasswordExpired: boolean;
|
|
20
20
|
passwordResetToken: string;
|
|
21
21
|
enter(phase: NavigationPhase<Settings>): void;
|
|
22
|
+
private applyResetIdentity;
|
|
22
23
|
onSubmit(): Promise<void>;
|
|
23
24
|
get headingText(): "Change Password" | "You are required to change your password";
|
|
25
|
+
get showIdentityFields(): boolean;
|
|
24
26
|
}
|
|
25
27
|
//# 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;AAQzC;;;;;;;;;;;;;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;IAMtC,OAAO,CAAC,kBAAkB;IAmBpB,QAAQ;IAwBd,IACI,WAAW,mEAEd;IAED,IACI,kBAAkB,YAErB;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,oEA8CjC,CAAC"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { isErrorEvent } from '@genesislcap/foundation-state-machine';
|
|
1
|
+
import { isDoneInvokeEvent, isErrorEvent } from '@genesislcap/foundation-state-machine';
|
|
2
2
|
import { assign } from 'xstate';
|
|
3
3
|
import { logger } from '../utils';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { nackErrorFromUnknown } from './errors';
|
|
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
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Set error action.
|
|
8
17
|
* @remarks
|
|
@@ -10,15 +19,16 @@ import { is200Nack } from './guards';
|
|
|
10
19
|
* @public
|
|
11
20
|
*/
|
|
12
21
|
export const setError = assign(({ event }) => {
|
|
22
|
+
var _a, _b;
|
|
13
23
|
if (isErrorEvent(event)) {
|
|
14
24
|
return {
|
|
15
|
-
error: event.data,
|
|
25
|
+
error: (_a = nackErrorFromUnknown(event.data)) !== null && _a !== void 0 ? _a : event.data,
|
|
16
26
|
};
|
|
17
27
|
}
|
|
18
|
-
if (
|
|
28
|
+
if (isDoneInvokeEvent(event)) {
|
|
19
29
|
logger.debug(`setError action called with non error event type.`, event);
|
|
20
30
|
return {
|
|
21
|
-
error:
|
|
31
|
+
error: (_b = nackErrorFromUnknown(event.output)) !== null && _b !== void 0 ? _b : event.output,
|
|
22
32
|
};
|
|
23
33
|
}
|
|
24
34
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
|
|
2
|
+
import { createErrorMap } from '@genesislcap/foundation-utils';
|
|
3
|
+
import { clearAuthErrorState } from './actions';
|
|
4
|
+
const Suite = createLogicSuite('clearAuthErrorState');
|
|
5
|
+
Suite('clears shared ErrorMap in place so startingContext does not keep stale errors', () => {
|
|
6
|
+
const errors = createErrorMap(() => { });
|
|
7
|
+
errors.set('reset-password-error', new Error('Password validation failed'));
|
|
8
|
+
errors.set('silent-login-error', new Error('ERROR_SILENT_LOGIN'));
|
|
9
|
+
const starting = { errors, error: undefined, params: undefined };
|
|
10
|
+
const context = { errors, error: new Error('stale'), params: { username: 'Jane' } };
|
|
11
|
+
const next = clearAuthErrorState(context, starting);
|
|
12
|
+
assert.is(errors.size, 0);
|
|
13
|
+
assert.is(next.error, undefined);
|
|
14
|
+
assert.is(next.errors, errors);
|
|
15
|
+
assert.is(next.params, undefined);
|
|
16
|
+
});
|
|
17
|
+
Suite('does not throw when errors is missing', () => {
|
|
18
|
+
const next = clearAuthErrorState({ error: new Error('x') });
|
|
19
|
+
assert.is(next.error, undefined);
|
|
20
|
+
});
|
|
21
|
+
Suite.run();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { APIError } from '@genesislcap/foundation-state-machine';
|
|
1
|
+
import { APIError, isAPIError } from '@genesislcap/foundation-state-machine';
|
|
2
|
+
import { StatusCodes } from 'http-status-codes';
|
|
3
|
+
import { fromDTONack, isNackDTO, isNackEntity } from '../mapper/utils';
|
|
2
4
|
/**
|
|
3
5
|
* NackError.
|
|
4
6
|
*
|
|
@@ -26,15 +28,44 @@ export class NackError extends APIError {
|
|
|
26
28
|
if (!entity) {
|
|
27
29
|
return null;
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return new NackError(entity.normalisedErrorStatusCode, entity, entity.normalisedErrorText);
|
|
31
|
+
if (entity.normalisedErrorText) {
|
|
32
|
+
return new NackError(entity.normalisedErrorStatusCode > 0
|
|
33
|
+
? entity.normalisedErrorStatusCode
|
|
34
|
+
: StatusCodes.INTERNAL_SERVER_ERROR, entity, entity.normalisedErrorText);
|
|
34
35
|
}
|
|
35
|
-
if (entity.
|
|
36
|
-
return new NackError(entity.normalisedWarningStatusCode
|
|
36
|
+
if (entity.normalisedWarningText) {
|
|
37
|
+
return new NackError(entity.normalisedWarningStatusCode > 0
|
|
38
|
+
? entity.normalisedWarningStatusCode
|
|
39
|
+
: StatusCodes.BAD_REQUEST, entity, entity.normalisedWarningText);
|
|
37
40
|
}
|
|
38
41
|
return null;
|
|
39
42
|
}
|
|
40
43
|
}
|
|
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,11 +1,19 @@
|
|
|
1
1
|
import { isDoneInvokeEvent } from '@genesislcap/foundation-state-machine';
|
|
2
|
-
import { isNackDTO, isNackEntity } from '../mapper';
|
|
2
|
+
import { isFailedAuthDTO, isNackDTO, isNackEntity } from '../mapper/utils';
|
|
3
3
|
/**
|
|
4
4
|
* is200Nack.
|
|
5
5
|
* @privateRemarks
|
|
6
|
-
* Required until http status codes are aligned on backend.
|
|
6
|
+
* Required until http status codes are aligned on backend. HTTP status is ignored;
|
|
7
|
+
* Genesis MESSAGE_TYPE / ERROR determine failure.
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
|
-
export const is200Nack = (event) =>
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export const is200Nack = (event) => {
|
|
11
|
+
if (!isDoneInvokeEvent(event)) {
|
|
12
|
+
return false;
|
|
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
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
|
|
2
|
+
import { is200Nack } from './guards';
|
|
3
|
+
import { isResetPasswordParams } from './types';
|
|
4
|
+
const Suite = createLogicSuite('auth machine password reset guards');
|
|
5
|
+
const nackDto = {
|
|
6
|
+
MESSAGE_TYPE: 'EVENT_NACK',
|
|
7
|
+
SOURCE_REF: 'ref',
|
|
8
|
+
ERROR: [
|
|
9
|
+
{
|
|
10
|
+
'@type': 'StandardError',
|
|
11
|
+
CODE: 'INTERNAL_ERROR',
|
|
12
|
+
TEXT: 'Password validation failed',
|
|
13
|
+
STATUS_CODE: '500 Internal Server Error',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
WARNING: [],
|
|
17
|
+
};
|
|
18
|
+
Suite('is200Nack is true for FetchMachineOutput wrapping EVENT_NACK', () => {
|
|
19
|
+
assert.ok(is200Nack({
|
|
20
|
+
type: 'done.invoke.resetPasswordFetcher',
|
|
21
|
+
output: { data: nackDto, response: { ok: true } },
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
Suite('is200Nack is true for EVENT_NACK even when HTTP is not ok', () => {
|
|
25
|
+
assert.ok(is200Nack({
|
|
26
|
+
type: 'done.invoke.resetPasswordFetcher',
|
|
27
|
+
output: { data: nackDto, response: { ok: false } },
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
Suite('is200Nack is false for EVENT_ACK without errors', () => {
|
|
31
|
+
assert.not.ok(is200Nack({
|
|
32
|
+
type: 'done.invoke.resetPasswordFetcher',
|
|
33
|
+
output: { data: { MESSAGE_TYPE: 'EVENT_ACK', SOURCE_REF: 'ref' }, response: { ok: true } },
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
Suite('isResetPasswordParams requires username, token and new password', () => {
|
|
37
|
+
assert.ok(isResetPasswordParams({
|
|
38
|
+
username: 'JaneDee',
|
|
39
|
+
resetToken: 'token',
|
|
40
|
+
newPassword: 'Password11*',
|
|
41
|
+
}));
|
|
42
|
+
assert.not.ok(isResetPasswordParams({
|
|
43
|
+
username: '',
|
|
44
|
+
resetToken: 'token',
|
|
45
|
+
newPassword: 'Password11*',
|
|
46
|
+
}));
|
|
47
|
+
assert.not.ok(isResetPasswordParams({
|
|
48
|
+
username: 'JaneDee',
|
|
49
|
+
resetToken: '',
|
|
50
|
+
newPassword: 'Password11*',
|
|
51
|
+
}));
|
|
52
|
+
});
|
|
53
|
+
Suite.run();
|
|
@@ -7,10 +7,11 @@ 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,
|
|
10
|
+
import { AuthMessageMapper, createHTTPHeadersFromDTO, isLoginAckEntity, isLoginDetailsAckEntity, isLoginNackEntity, isLogoutAckEntity, isLogoutNackEntity, isFailedAuthDTO, } from '../mapper';
|
|
11
|
+
import { clearResetIdentity } from '../routes/reset-password/reset-identity';
|
|
11
12
|
import { AuthRouting } from '../routes/routing';
|
|
12
13
|
import { logger } from '../utils';
|
|
13
|
-
import { setError } from './actions';
|
|
14
|
+
import { clearAuthErrorState, setError } from './actions';
|
|
14
15
|
import { defaultAuthMachineContext, isLoginParams, isQueryParams } from './types';
|
|
15
16
|
/**
|
|
16
17
|
* Default AuthMachine.
|
|
@@ -49,6 +50,10 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
49
50
|
actions,
|
|
50
51
|
target: '#authMachine.resetPassword',
|
|
51
52
|
},
|
|
53
|
+
dismiss: {
|
|
54
|
+
actions: ['resetContext'],
|
|
55
|
+
target: '#authMachine.idle',
|
|
56
|
+
},
|
|
52
57
|
};
|
|
53
58
|
};
|
|
54
59
|
this.dtoTransition = () => ({
|
|
@@ -236,7 +241,15 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
236
241
|
invoke: {
|
|
237
242
|
id: 'forgotPasswordFetcher',
|
|
238
243
|
src: fetchMachine.machine,
|
|
239
|
-
onDone:
|
|
244
|
+
onDone: [
|
|
245
|
+
{
|
|
246
|
+
guard: 'is200NackDTO',
|
|
247
|
+
target: 'error.forgotPassword',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
target: 'feedback.forgotPassword',
|
|
251
|
+
},
|
|
252
|
+
],
|
|
240
253
|
onError: 'error.forgotPassword',
|
|
241
254
|
},
|
|
242
255
|
entry: [
|
|
@@ -294,19 +307,26 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
294
307
|
invoke: {
|
|
295
308
|
id: 'resetPasswordFetcher',
|
|
296
309
|
src: fetchMachine.machine,
|
|
297
|
-
onDone:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
onDone: [
|
|
311
|
+
{
|
|
312
|
+
guard: 'is200NackDTO',
|
|
313
|
+
target: 'error.resetPassword',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
actions: [
|
|
317
|
+
({ context }) => {
|
|
318
|
+
const params = context.params;
|
|
319
|
+
this.cm.storeCredentials({
|
|
320
|
+
id: params.username,
|
|
321
|
+
name: params.username,
|
|
322
|
+
password: params.newPassword,
|
|
323
|
+
});
|
|
324
|
+
},
|
|
325
|
+
() => clearResetIdentity(),
|
|
326
|
+
],
|
|
327
|
+
target: 'feedback.resetPassword',
|
|
328
|
+
},
|
|
329
|
+
],
|
|
310
330
|
onError: 'error.resetPassword',
|
|
311
331
|
},
|
|
312
332
|
entry: [
|
|
@@ -454,6 +474,12 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
454
474
|
*/
|
|
455
475
|
feedback: {
|
|
456
476
|
initial: 'none',
|
|
477
|
+
on: {
|
|
478
|
+
dismiss: {
|
|
479
|
+
actions: ['resetContext'],
|
|
480
|
+
target: '#authMachine.idle',
|
|
481
|
+
},
|
|
482
|
+
},
|
|
457
483
|
states: {
|
|
458
484
|
none: {
|
|
459
485
|
tags: ['feedback', 'none'],
|
|
@@ -616,7 +642,7 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
616
642
|
}
|
|
617
643
|
},
|
|
618
644
|
setError,
|
|
619
|
-
resetContext: assign(() => this.startingContext),
|
|
645
|
+
resetContext: assign(({ context }) => clearAuthErrorState(context, this.startingContext)),
|
|
620
646
|
preventSilentAccess: () => __awaiter(this, void 0, void 0, function* () {
|
|
621
647
|
yield this.cm.preventSilentAccess();
|
|
622
648
|
}),
|
|
@@ -675,11 +701,12 @@ let DefaultAuthMachine = class DefaultAuthMachine extends AbstractMachine {
|
|
|
675
701
|
isLogoutNackEntity: ({ event }) => isDoneInvokeEvent(event) ? isLogoutNackEntity(event.output) : false,
|
|
676
702
|
/**
|
|
677
703
|
* 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.
|
|
678
705
|
*/
|
|
679
706
|
is200NackDTO: ({ event }) => {
|
|
680
|
-
var _a
|
|
707
|
+
var _a;
|
|
681
708
|
return isDoneInvokeEvent(event)
|
|
682
|
-
? ((
|
|
709
|
+
? isFailedAuthDTO((_a = event.output) === null || _a === void 0 ? void 0 : _a.data)
|
|
683
710
|
: false;
|
|
684
711
|
},
|
|
685
712
|
},
|
package/dist/esm/mapper/utils.js
CHANGED
|
@@ -107,6 +107,22 @@ 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
|
+
}
|
|
110
126
|
/**
|
|
111
127
|
* isNackEntity.
|
|
112
128
|
* @param entity - Potential Nack.
|